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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/S3ClientBEProperties.java:
##########
@@ -23,20 +23,25 @@
 import org.apache.doris.datasource.property.constants.ObsProperties;
 import org.apache.doris.datasource.property.constants.OssProperties;
 import org.apache.doris.datasource.property.constants.S3Properties;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.HashMap;
 import java.util.Map;
 
 public class S3ClientBEProperties {
+    private static final Logger LOG = 
LogManager.getLogger(S3ClientBEProperties.class);
 
     /**
      *  convert FE properties to BE S3 client properties
      *  On BE, should use properties like AWS_XXX.
      */
     public static Map<String, String> getBeFSProperties(Map<String, String> 
properties) {
         if (properties.containsKey(MinioProperties.ENDPOINT)) {
-            // minio does not have region, use an arbitrary one.
-            properties.put(MinioProperties.REGION, "us-east-1");
+            if (!properties.containsKey(MinioProperties.REGION)) {
+                LOG.warn("Region has not set, use default s3 region: 
'us-east-1'.");

Review Comment:
   ```suggestion
                   LOG.debug("Region has not set, use default s3 region: 
'us-east-1'.");
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java:
##########
@@ -309,8 +309,10 @@ private static Map<String, String> 
convertToCOSProperties(Map<String, String> pr
     }
 
     private static Map<String, String> convertToMinioProperties(Map<String, 
String> props, CloudCredential credential) {
-        // minio does not have region, use an arbitrary one.
-        props.put(MinioProperties.REGION, "us-east-1");
+        if (!props.containsKey(MinioProperties.REGION)) {
+            LOG.warn("Region has not set, use default s3 region: 
'us-east-1'.");

Review Comment:
   ```suggestion
               LOG.debug("Region has not set, use default s3 region: 
'us-east-1'.");
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/S3TableValuedFunction.java:
##########
@@ -77,8 +78,13 @@ public S3TableValuedFunction(Map<String, String> params) 
throws AnalysisExceptio
         final String endpoint = forceVirtualHosted
                 ? getEndpointAndSetVirtualBucket(params)
                 : s3uri.getBucketScheme();
+        if (!tvfParams.containsKey(S3Properties.REGION)) {
+            String region = S3Properties.getRegionOfEndpoint(endpoint);
+            LOG.warn("Region has not set, use default s3 region: {}", region);

Review Comment:
   ```suggestion
               LOG.debug("Region has not set, use default s3 region: {}", 
region);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to