carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject carbondata git commit: fix error of 'Problem while intermediate merging' when loading data
Date Sat, 29 Jul 2017 00:25:27 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 09f7cdd44 -> 66d0b3930


fix error of 'Problem while intermediate merging' when loading data

fix the code of method SortIntermediateFileMerger.startIntermediateMerging.

This closes #1206


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/66d0b393
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/66d0b393
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/66d0b393

Branch: refs/heads/master
Commit: 66d0b393034a62d5b02bf1ec9bed303f17fdb765
Parents: 09f7cdd
Author: Zhang Zhichao <441586683@qq.com>
Authored: Fri Jul 28 16:13:40 2017 +0800
Committer: chenliang613 <chenliang613@apache.org>
Committed: Sat Jul 29 08:25:11 2017 +0800

----------------------------------------------------------------------
 .../sortandgroupby/sortdata/SortIntermediateFileMerger.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/66d0b393/processing/src/main/java/org/apache/carbondata/processing/sortandgroupby/sortdata/SortIntermediateFileMerger.java
----------------------------------------------------------------------
diff --git a/processing/src/main/java/org/apache/carbondata/processing/sortandgroupby/sortdata/SortIntermediateFileMerger.java
b/processing/src/main/java/org/apache/carbondata/processing/sortandgroupby/sortdata/SortIntermediateFileMerger.java
index f940375..383498c 100644
--- a/processing/src/main/java/org/apache/carbondata/processing/sortandgroupby/sortdata/SortIntermediateFileMerger.java
+++ b/processing/src/main/java/org/apache/carbondata/processing/sortandgroupby/sortdata/SortIntermediateFileMerger.java
@@ -19,6 +19,7 @@ package org.apache.carbondata.processing.sortandgroupby.sortdata;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Random;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
@@ -84,8 +85,10 @@ public class SortIntermediateFileMerger {
    * @param intermediateFiles
    */
   private void startIntermediateMerging(File[] intermediateFiles) {
+    int index = new Random().nextInt(parameters.getTempFileLocation().length);
+    String chosenTempDir = parameters.getTempFileLocation()[index];
     File file = new File(
-        parameters.getTempFileLocation() + File.separator + parameters.getTableName() + System
+        chosenTempDir + File.separator + parameters.getTableName() + System
             .nanoTime() + CarbonCommonConstants.MERGERD_EXTENSION);
     IntermediateFileMerger merger = new IntermediateFileMerger(parameters, intermediateFiles,
file);
     executorService.submit(merger);


Mime
View raw message