morningman commented on code in PR #16573:
URL: https://github.com/apache/doris/pull/16573#discussion_r1101614024


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/HMSResource.java:
##########
@@ -97,7 +97,33 @@ protected void getProcNodeData(BaseProcResult result) {
         }
     }
 
+    private static void getPropertiesFromDLFProps(Map<String, String> props) {
+        // add transformed properties
+        String propsMetastoreType = props.get(HIVE_METASTORE_TYPE);
+        if (!DLF_TYPE.equalsIgnoreCase(propsMetastoreType)) {
+            return;
+        }
+        props.put(S3Resource.S3_ACCESS_KEY, 
props.getOrDefault("dlf.catalog.accessKeyId", ""));
+        props.put(S3Resource.S3_SECRET_KEY, 
props.getOrDefault("dlf.catalog.accessKeySecret", ""));
+        String region = props.get("dlf.catalog.region");
+        if (!Strings.isNullOrEmpty(region)) {
+            props.put(S3Resource.S3_REGION, "oss-" + region);
+            String publicAccess = 
props.getOrDefault("dlf.catalog.accessPublic", "false");
+            props.put(S3Resource.S3_ENDPOINT, getDLFEndpont(region, 
Boolean.parseBoolean(publicAccess)));
+        }
+    }
+
+    private static String getDLFEndpont(String region, boolean publicAccess) {
+        String prefix = "http://oss-";;
+        String suffix = ".aliyuncs.com";
+        if (!publicAccess) {
+            suffix = "-internal" + suffix;
+        }
+        return prefix + region + suffix;
+    }
+
     public static Map<String, String> getPropertiesFromDLF(Map<String, String> 
res) {
+        getPropertiesFromDLFProps(res);

Review Comment:
   The priority from high to low is:
   1. properties in create catalog stmt
   2. properties in resource
   3. properties in xml



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to