This is an automated email from the ASF dual-hosted git repository.
kunalkapoor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git
The following commit(s) were added to refs/heads/master by this push:
new eb7757b [CARBONDATA-3910] Fix load failure in cluster when csv
present in local file system in case of global sort
eb7757b is described below
commit eb7757b912f8dd3e8cb510d4fc5d50940c3d63ce
Author: akashrn5 <[email protected]>
AuthorDate: Sun Jul 12 21:38:45 2020 +0530
[CARBONDATA-3910] Fix load failure in cluster when csv present in local
file system in case of global sort
Why is this PR needed?
when the csv file is present in local file system and we load the table in
cluster, it fails with file not found.
This is because when we try to update the file path, we remove one slash in
schema which causes this issue.
What changes were proposed in this PR?
Its better to check for "file:/" instead of "file:///" for local file, as
getUpdatedfilePath API may remove
one slash and cause this issue.
This closes #3838
---
.../org/apache/carbondata/core/constants/CarbonCommonConstants.java | 2 +-
.../org/apache/carbondata/core/metadata/AbsoluteTableIdentifier.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git
a/core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java
b/core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java
index d5808ac..2e48a7a 100644
---
a/core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java
+++
b/core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java
@@ -1631,7 +1631,7 @@ public final class CarbonCommonConstants {
public static final String HDFSURL_PREFIX = "hdfs://";
- public static final String LOCAL_FILE_PREFIX = "file://";
+ public static final String LOCAL_FILE_PREFIX = "file:/";
public static final String VIEWFSURL_PREFIX = "viewfs://";
diff --git
a/core/src/main/java/org/apache/carbondata/core/metadata/AbsoluteTableIdentifier.java
b/core/src/main/java/org/apache/carbondata/core/metadata/AbsoluteTableIdentifier.java
index 5d99872..7f04512 100644
---
a/core/src/main/java/org/apache/carbondata/core/metadata/AbsoluteTableIdentifier.java
+++
b/core/src/main/java/org/apache/carbondata/core/metadata/AbsoluteTableIdentifier.java
@@ -82,7 +82,7 @@ public class AbsoluteTableIdentifier implements Serializable {
public String appendWithLocalPrefix(String path) {
if (tablePath.startsWith(CarbonCommonConstants.LOCAL_FILE_PREFIX)) {
- return CarbonCommonConstants.LOCAL_FILE_PREFIX + path;
+ return CarbonCommonConstants.LOCAL_FILE_PREFIX +
CarbonCommonConstants.FILE_SEPARATOR + path;
} else {
return path;
}