carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject [1/2] incubator-carbondata git commit: Fixed folder path issue which contains '-'
Date Sat, 02 Jul 2016 06:34:33 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 6e943ff73 -> 2cdeb89e2


Fixed folder path issue which contains '-'


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

Branch: refs/heads/master
Commit: 440c9da97767fcc39c9bc9a78da36d12f8b48cdf
Parents: 6e943ff
Author: ravipesala <ravi.pesala@gmail.com>
Authored: Sat Jul 2 11:03:40 2016 +0530
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Sat Jul 2 11:03:40 2016 +0530

----------------------------------------------------------------------
 .../core/carbon/path/CarbonTablePath.java       | 30 ++++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/440c9da9/core/src/main/java/org/carbondata/core/carbon/path/CarbonTablePath.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/core/carbon/path/CarbonTablePath.java b/core/src/main/java/org/carbondata/core/carbon/path/CarbonTablePath.java
index bf2ef57..2ac6817 100644
--- a/core/src/main/java/org/carbondata/core/carbon/path/CarbonTablePath.java
+++ b/core/src/main/java/org/carbondata/core/carbon/path/CarbonTablePath.java
@@ -305,33 +305,39 @@ public class CarbonTablePath extends Path {
      * gets updated timestamp information from given carbon data file name
      */
     public static String getUpdateTimeStamp(String carbonDataFileName) {
+      // Get the file name from path
+      String fileName = new File(carbonDataFileName).getName();
       // + 1 for size of "-"
-      int firstDashPos = carbonDataFileName.indexOf("-");
-      int secondDashPos = carbonDataFileName.indexOf("-", firstDashPos + 1);
-      int startIndex = carbonDataFileName.indexOf("-", secondDashPos + 1) + 1;
-      int endIndex = carbonDataFileName.indexOf(".");
-      return carbonDataFileName.substring(startIndex, endIndex);
+      int firstDashPos = fileName.indexOf("-");
+      int secondDashPos = fileName.indexOf("-", firstDashPos + 1);
+      int startIndex = fileName.indexOf("-", secondDashPos + 1) + 1;
+      int endIndex = fileName.indexOf(".");
+      return fileName.substring(startIndex, endIndex);
     }
 
     /**
      * gets file part number information from given carbon data file name
      */
     public static String getPartNo(String carbonDataFileName) {
+      // Get the file name from path
+      String fileName = new File(carbonDataFileName).getName();
       // + 1 for size of "-"
-      int startIndex = carbonDataFileName.indexOf("-") + 1;
-      int endIndex = carbonDataFileName.indexOf("-", startIndex);
-      return carbonDataFileName.substring(startIndex, endIndex);
+      int startIndex = fileName.indexOf("-") + 1;
+      int endIndex = fileName.indexOf("-", startIndex);
+      return fileName.substring(startIndex, endIndex);
     }
 
     /**
      * gets updated timestamp information from given carbon data file name
      */
     public static String getTaskNo(String carbonDataFileName) {
+      // Get the file name from path
+      String fileName = new File(carbonDataFileName).getName();
       // + 1 for size of "-"
-      int firstDashPos = carbonDataFileName.indexOf("-");
-      int startIndex = carbonDataFileName.indexOf("-", firstDashPos + 1) + 1;
-      int endIndex = carbonDataFileName.indexOf("-", startIndex);
-      return carbonDataFileName.substring(startIndex, endIndex);
+      int firstDashPos = fileName.indexOf("-");
+      int startIndex = fileName.indexOf("-", firstDashPos + 1) + 1;
+      int endIndex = fileName.indexOf("-", startIndex);
+      return fileName.substring(startIndex, endIndex);
     }
   }
 


Mime
View raw message