Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public LocationPath(String location, Map<String, String> props) {
private LocationPath(String originLocation, Map<String, String> props, boolean convertPath) {
isBindBroker = props.containsKey(HMSExternalCatalog.BIND_BROKER_NAME);
String tmpLocation = originLocation;
if (!originLocation.contains(SCHEME_DELIM)) {
if (!(originLocation.contains(SCHEME_DELIM) || originLocation.contains(NONSTANDARD_SCHEME_DELIM))) {
// Sometimes the file path does not contain scheme, need to add default fs
// eg, /path/to/file.parquet -> hdfs://nn/path/to/file.parquet
// the default fs is from the catalog properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,16 @@ public void testNoSchemeLocation() {
String beLocation = locationPath.toStorageLocation().toString();
Assertions.assertTrue(beLocation.equalsIgnoreCase("/path/to/local"));
}

@Test
public void testLocalFileSystem() {
HashMap<String, String> props = new HashMap<>();
props.put("fs.defaultFS", "hdfs:///xyz");
LocationPath p1 = new LocationPath("file:///abc/def", props);
Assertions.assertEquals(Scheme.LOCAL, p1.getScheme());
LocationPath p2 = new LocationPath("file:/abc/def", props);
Assertions.assertEquals(Scheme.LOCAL, p2.getScheme());
LocationPath p3 = new LocationPath("file://authority/abc/def", props);
Assertions.assertEquals(Scheme.LOCAL, p3.getScheme());
}
}
Loading