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 relative store path issue while update and delete
Date Sun, 07 May 2017 03:51:19 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 5e851378c -> ce84e1914


Fixed relative store path issue while update and delete


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

Branch: refs/heads/master
Commit: 2d1c729c68fb2f50f55e5b258d8d134994d807d7
Parents: 5e85137
Author: ravipesala <ravi.pesala@gmail.com>
Authored: Sun May 7 08:39:28 2017 +0530
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Sun May 7 08:39:28 2017 +0530

----------------------------------------------------------------------
 .../carbondata/core/datastore/impl/FileFactory.java  | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/2d1c729c/core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java
b/core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java
index 27931fe..c32b956 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java
@@ -461,9 +461,18 @@ public final class FileFactory {
       case LOCAL:
       default:
         if (filePath != null && !filePath.isEmpty()) {
-          Path pathWithoutSchemeAndAuthority =
-              Path.getPathWithoutSchemeAndAuthority(new Path(filePath));
-          return pathWithoutSchemeAndAuthority.toString();
+          // If the store path is relative then convert to absolute path.
+          if (filePath.startsWith("./")) {
+            try {
+              return new File(filePath).getCanonicalPath();
+            } catch (IOException e) {
+              throw new RuntimeException(e);
+            }
+          } else {
+            Path pathWithoutSchemeAndAuthority =
+                Path.getPathWithoutSchemeAndAuthority(new Path(filePath));
+            return pathWithoutSchemeAndAuthority.toString();
+          }
         } else {
           return filePath;
         }


Mime
View raw message