xubo245 commented on a change in pull request #3886:
URL: https://github.com/apache/carbondata/pull/3886#discussion_r468283733



##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertFromStageCommand.scala
##########
@@ -499,25 +499,31 @@ case class CarbonInsertFromStageCommand(
    * return the loading files failed to create
    */
   private def createStageLoadingFiles(
+      stagePath: String,
       executorService: ExecutorService,
       stageFiles: Array[(CarbonFile, CarbonFile)]): Array[(CarbonFile, 
CarbonFile)] = {
     stageFiles.map { files =>
       executorService.submit(new Callable[(CarbonFile, CarbonFile, Boolean)] {
         override def call(): (CarbonFile, CarbonFile, Boolean) = {
-          // Get the loading files path
-          val stageLoadingFile =
-            FileFactory.getCarbonFile(files._1.getAbsolutePath +
-              CarbonTablePath.LOADING_FILE_SUFFIX);
-          // Try to create loading files
-          // make isFailed to be true if createNewFile return false.
-          // the reason can be file exists or exceptions.
-          var isFailed = !stageLoadingFile.createNewFile()
-          // if file exists, modify the lastModifiedTime of the file.
-          if (isFailed) {
-            // make isFailed to be true if setLastModifiedTime return false.
-            isFailed = 
!stageLoadingFile.setLastModifiedTime(System.currentTimeMillis());
+          try {
+            // Get the loading files path
+            val stageLoadingFile =
+              FileFactory.getCarbonFile(stagePath +
+                CarbonCommonConstants.FILE_SEPARATOR +

Review comment:
       Suggestion: use File.separator instead of 
CarbonCommonConstants.FILE_SEPARATOR, File.separator can support linux and 
window。




----------------------------------------------------------------
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.

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


Reply via email to