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 2318532cba697f..4ca8f9605a06fa 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 @@ -87,7 +87,7 @@ public LocationPath(String location, Map props) { this(location, props, true); } - private LocationPath(String originLocation, Map props, boolean convertPath) { + public LocationPath(String originLocation, Map props, boolean convertPath) { isBindBroker = props.containsKey(HMSExternalCatalog.BIND_BROKER_NAME); String tmpLocation = originLocation; if (!(originLocation.contains(SCHEME_DELIM) || originLocation.contains(NONSTANDARD_SCHEME_DELIM))) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java b/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java index 3635d10633f108..a4012d357e55ad 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java @@ -122,13 +122,13 @@ public void bindDataSink(Optional insertCtx) setSerDeProperties(tSink); THiveLocationParams locationParams = new THiveLocationParams(); - LocationPath locationPath = new LocationPath(sd.getLocation(), targetTable.getHadoopProperties()); + LocationPath locationPath = new LocationPath(sd.getLocation(), targetTable.getHadoopProperties(), false); String location = locationPath.getPath().toString(); String storageLocation = locationPath.toStorageLocation().toString(); TFileType fileType = locationPath.getTFileTypeForBE(); if (fileType == TFileType.FILE_S3) { locationParams.setWritePath(storageLocation); - locationParams.setOriginalWritePath(sd.getLocation()); + locationParams.setOriginalWritePath(location); locationParams.setTargetPath(location); if (insertCtx.isPresent()) { HiveInsertCommandContext context = (HiveInsertCommandContext) insertCtx.get(); diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java index 8794a56eac9138..b57bbcb51a2772 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java @@ -32,8 +32,8 @@ import org.apache.hadoop.hive.metastore.api.SerDeInfo; import org.apache.hadoop.hive.metastore.api.StorageDescriptor; import org.apache.hadoop.hive.metastore.api.Table; +import org.junit.Assert; import org.junit.Test; -import org.locationtech.jts.util.Assert; import java.util.ArrayList; import java.util.HashMap; @@ -94,7 +94,8 @@ public HMSCachedClient getClient() { HiveTableSink hiveTableSink = new HiveTableSink(tbl); hiveTableSink.bindDataSink(Optional.empty()); - Assert.equals(hiveTableSink.tDataSink.hive_table_sink.location.original_write_path, location); + Assert.assertEquals(hiveTableSink.tDataSink.hive_table_sink.location.original_write_path, location); + Assert.assertEquals(hiveTableSink.tDataSink.hive_table_sink.location.target_path, location); } }