From d8bedafcf46811e36a53a50d6e8090400c6b43b3 Mon Sep 17 00:00:00 2001 From: slothever <18522955+wsjz@users.noreply.github.com> Date: Fri, 17 May 2024 22:43:59 +0800 Subject: [PATCH] [fix](multi-catalog)remove http scheme in oss endpoint (#34907) remove http scheme in oss endpoint, scheme maybe appear in url (http://bucket.http//.region.aliyuncs.com) if use http client (cherry picked from commit db34ad528db6dc67b721f4ba0b6a36e342732a02) --- .../apache/doris/datasource/property/PropertyConverter.java | 2 +- .../doris/datasource/property/PropertyConverterTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java index 66396e2c337ca2..e5a62fc57f1641 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java @@ -480,7 +480,7 @@ private static void putNewPropertiesForCompatibility(Map props, } private static String getOssEndpoint(String region, boolean publicAccess) { - String prefix = "http://oss-"; + String prefix = "oss-"; String suffix = ".aliyuncs.com"; if (!publicAccess) { suffix = "-internal" + suffix; diff --git a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/PropertyConverterTest.java b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/PropertyConverterTest.java index 7b2f5d4c0ac68e..aad0cf4a990607 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/PropertyConverterTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/PropertyConverterTest.java @@ -336,7 +336,7 @@ public void testDlfPropertiesConverter() throws Exception { Map hdProps = catalog.getCatalogProperty().getHadoopProperties(); Assertions.assertEquals("akk", hdProps.get(OssProperties.ACCESS_KEY)); Assertions.assertEquals("skk", hdProps.get(OssProperties.SECRET_KEY)); - Assertions.assertEquals("http://oss-cn-beijing-internal.aliyuncs.com", + Assertions.assertEquals("oss-cn-beijing-internal.aliyuncs.com", hdProps.get(OssProperties.ENDPOINT)); String queryDlf2 = "create catalog hms_dlf2 properties (\n" @@ -392,7 +392,7 @@ public void testDlfPropertiesConverter() throws Exception { Map hdProps3 = catalog3.getCatalogProperty().getHadoopProperties(); Assertions.assertEquals("akk", hdProps3.get(OssProperties.ACCESS_KEY)); Assertions.assertEquals("skk", hdProps3.get(OssProperties.SECRET_KEY)); - Assertions.assertEquals("http://oss-cn-beijing-internal.aliyuncs.com", hdProps3.get(OssProperties.ENDPOINT)); + Assertions.assertEquals("oss-cn-beijing-internal.aliyuncs.com", hdProps3.get(OssProperties.ENDPOINT)); } @Test