Github user kumarvishal09 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2752#discussion_r220173275 --- Diff: processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java --- @@ -270,12 +270,18 @@ protected void commitCurrentFile(boolean copyInCurrentThread) { notifyDataMapBlockEnd(); CarbonUtil.closeStreams(this.fileOutputStream, this.fileChannel); if (!enableDirectlyWriteData2Hdfs) { - if (copyInCurrentThread) { - CarbonUtil.copyCarbonDataFileToCarbonStorePath(carbonDataFileTempPath, - model.getCarbonDataDirectoryPath(), fileSizeInBytes); - } else { - executorServiceSubmitList.add(executorService.submit( - new CompleteHdfsBackendThread(carbonDataFileTempPath))); + try { + if (copyInCurrentThread) { + CarbonUtil.copyCarbonDataFileToCarbonStorePath(carbonDataFileTempPath, + model.getCarbonDataDirectoryPath(), fileSizeInBytes); + FileFactory + .deleteFile(carbonDataFileTempPath, FileFactory.getFileType(carbonDataFileTempPath)); + } else { + executorServiceSubmitList --- End diff -- When copying in different thread there also we need to delete carbondata file, i think this you have missed , please check
---