carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject [35/50] [abbrv] incubator-carbondata git commit: [Bug] Finding the merge folder name using int. (#772)
Date Thu, 30 Jun 2016 17:42:22 GMT
[Bug] Finding the merge folder name using int. (#772)



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

Branch: refs/heads/master
Commit: 114b4717995c7e7f0812516ee054737d459f79a9
Parents: b5fc518
Author: ravikiran23 <ravikiran.sn042@gmail.com>
Authored: Wed Jun 29 23:57:38 2016 +0530
Committer: Venkata Ramana G <g.ramana.v@gmail.com>
Committed: Wed Jun 29 23:57:38 2016 +0530

----------------------------------------------------------------------
 .../spark/merger/CarbonDataMergerUtil.java           | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/114b4717/integration/spark/src/main/java/org/carbondata/spark/merger/CarbonDataMergerUtil.java
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/java/org/carbondata/spark/merger/CarbonDataMergerUtil.java
b/integration/spark/src/main/java/org/carbondata/spark/merger/CarbonDataMergerUtil.java
index 52e8a08..3aa66c2 100644
--- a/integration/spark/src/main/java/org/carbondata/spark/merger/CarbonDataMergerUtil.java
+++ b/integration/spark/src/main/java/org/carbondata/spark/merger/CarbonDataMergerUtil.java
@@ -113,14 +113,17 @@ public final class CarbonDataMergerUtil {
    */
   public static String getMergedLoadName(List<LoadMetadataDetails> segmentsToBeMergedList)
{
     String firstSegmentName = segmentsToBeMergedList.get(0).getLoadName();
-    // check if segment is already merged or not.
-    if (null != segmentsToBeMergedList.get(0).getMergedLoadName()) {
-      firstSegmentName = segmentsToBeMergedList.get(0).getMergedLoadName();
+    if (firstSegmentName.contains(".")) {
+      String beforeDecimal = firstSegmentName.substring(0, firstSegmentName.indexOf("."));
+      String afterDecimal = firstSegmentName.substring(firstSegmentName.indexOf(".") + 1);
+      int fraction = Integer.parseInt(afterDecimal) + 1;
+      String mergedSegmentName = beforeDecimal + "." + fraction;
+      return CarbonCommonConstants.LOAD_FOLDER + mergedSegmentName;
+    } else {
+      String mergeName = firstSegmentName + "." + 1;
+      return CarbonCommonConstants.LOAD_FOLDER + mergeName;
     }
 
-    float segmentNumber = Float.parseFloat(firstSegmentName);
-    segmentNumber += 0.1;
-    return CarbonCommonConstants.LOAD_FOLDER + segmentNumber;
   }
 
   public static boolean updateLoadMetadataWithMergeStatus(List<LoadMetadataDetails>
loadsToMerge,


Mime
View raw message