Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/3003#discussion_r243530948
--- Diff:
processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java
---
@@ -272,18 +272,44 @@ protected void commitCurrentFile(boolean
copyInCurrentThread) {
CarbonUtil.closeStreams(this.fileOutputStream, this.fileChannel);
if (!enableDirectlyWriteDataToStorePath) {
try {
- if (copyInCurrentThread) {
-
CarbonUtil.copyCarbonDataFileToCarbonStorePath(carbonDataFileTempPath,
- model.getCarbonDataDirectoryPath(), fileSizeInBytes);
+ if (currentFileSize == 0) {
FileFactory
.deleteFile(carbonDataFileTempPath,
FileFactory.getFileType(carbonDataFileTempPath));
+ if (blockIndexInfoList.size() > 0 &&
blockIndexInfoList.get(blockIndexInfoList.size() - 1)
--- End diff --
Please extract this to some method .....below else and this condition are
same
---