This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new 9e127f224e5 branch-3.0: [fix](external)fix split and get the schema #45408 (#45565) 9e127f224e5 is described below commit 9e127f224e53134a22174a5f066c2c63a9195fe1 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> AuthorDate: Tue Dec 31 22:14:44 2024 +0800 branch-3.0: [fix](external)fix split and get the schema #45408 (#45565) Cherry-picked from #45408 Co-authored-by: wuwenchi <wuwen...@selectdb.com> --- .../main/java/org/apache/doris/common/util/LocationPath.java | 2 +- .../java/org/apache/doris/common/util/LocationPathTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java b/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java index 4604e4deabb..2318532cba6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java @@ -90,7 +90,7 @@ public class LocationPath { 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 diff --git a/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java b/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java index 9d1edadd919..4457b7dd1ef 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java @@ -205,4 +205,16 @@ public class LocationPathTest { 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()); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org