[GitHub] carbondata pull request #3003: [CARBONDATA-3186]Avoid creating empty carbond...
Github user asfgit closed the pull request at: https://github.com/apache/carbondata/pull/3003 ---
[GitHub] carbondata pull request #3003: [CARBONDATA-3186]Avoid creating empty carbond...
Github user ajantha-bhat commented on a diff in the pull request: https://github.com/apache/carbondata/pull/3003#discussion_r243770677 --- 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 -- not same, paths are different. Now moved into a method that takes path. ---
[GitHub] carbondata pull request #3003: [CARBONDATA-3186]Avoid creating empty carbond...
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 ---