bowenliang123 commented on code in PR #6335:
URL: https://github.com/apache/kyuubi/pull/6335#discussion_r1704963077


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala:
##########
@@ -190,20 +191,21 @@ private[v1] class BatchesResource extends 
ApiRequestContext with Logging {
   def openBatchSessionWithUpload(
       @FormDataParam("batchRequest") batchRequest: BatchRequest,
       @FormDataParam("resourceFile") resourceFileInputStream: InputStream,
-      @FormDataParam("resourceFile") resourceFileMetadata: 
FormDataContentDisposition): Batch = {
+      @FormDataParam("resourceFile") resourceFileMetadata: 
FormDataContentDisposition,
+      formDataMultiPart: FormDataMultiPart): Batch = {
     require(
       fe.getConf.get(BATCH_RESOURCE_UPLOAD_ENABLED),
       "Batch resource upload function is disabled.")
     require(
       batchRequest != null,
       "batchRequest is required and please check the content type" +
         " of batchRequest is application/json")
-    val tempFile = Utils.writeToTempFile(
-      resourceFileInputStream,
-      KyuubiApplicationManager.uploadWorkDir,
-      resourceFileMetadata.getFileName)
-    batchRequest.setResource(tempFile.getPath)
-    openBatchSessionInternal(batchRequest, isResourceFromUpload = true)
+    openBatchSessionInternal(

Review Comment:
   No. In my first draft, I do the uploading and file saving in function 
`openBatchSessionWithUpload`. But then moved into `openBatchSessionInternal`, 
for two reasons, 1. we need the batchId for uploading path , 2. do more checks 
on request before saving file preventing unnecessary local files.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org
For additional commands, e-mail: notifications-h...@kyuubi.apache.org

Reply via email to