kaijchen commented on code in PR #39957:
URL: https://github.com/apache/doris/pull/39957#discussion_r1738060772


##########
be/src/util/s3_util.cpp:
##########
@@ -370,7 +370,7 @@ Status S3ClientFactory::convert_properties_to_s3_conf(
         }
     }
     if (auto it = properties.find(S3_PROVIDER); it != properties.end()) {
-        if (0 == strcmp(it->second.c_str(), AZURE_PROVIDER_STRING)) {
+        if (0 == strcasecmp(it->second.c_str(), AZURE_PROVIDER_STRING)) {

Review Comment:
   ```suggestion
           // S3 Provider properties should be case insensitive.
           if (0 == strcasecmp(it->second.c_str(), AZURE_PROVIDER_STRING)) {
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/StageProperties.java:
##########
@@ -135,7 +135,7 @@ private void analyzeStorageProperties() throws 
AnalysisException {
         }
         properties.put(PREFIX, prefix);
         // analyze provider
-        String provider = properties.get(PROVIDER);
+        String provider = properties.get(PROVIDER).toUpperCase();

Review Comment:
   ```suggestion
           // S3 Provider properties should be case insensitive.
           String provider = properties.get(PROVIDER).toUpperCase();
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/LoadStmt.java:
##########
@@ -527,7 +527,7 @@ private String getProviderFromEndpoint() {
         Map<String, String> properties = brokerDesc.getProperties();
         for (Map.Entry<String, String> entry : properties.entrySet()) {
             if (entry.getKey().equalsIgnoreCase(S3Properties.PROVIDER)) {
-                return entry.getValue();
+                return entry.getValue().toUpperCase();

Review Comment:
   ```suggestion
                   // S3 Provider properties should be case insensitive.
                   return entry.getValue().toUpperCase();
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/CopyStmt.java:
##########
@@ -205,7 +205,7 @@ private void analyzeStagePB(StagePB stagePB) throws 
AnalysisException {
         }
         brokerProperties.put(S3_BUCKET, objInfo.getBucket());
         brokerProperties.put(S3_PREFIX, objInfo.getPrefix());
-        brokerProperties.put(S3Properties.PROVIDER, 
objInfo.getProvider().toString());
+        brokerProperties.put(S3Properties.PROVIDER, 
objInfo.getProvider().toString().toUpperCase());

Review Comment:
   ```suggestion
           // S3 Provider properties should be case insensitive.
           brokerProperties.put(S3Properties.PROVIDER, 
objInfo.getProvider().toString().toUpperCase());
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/constants/S3Properties.java:
##########
@@ -330,7 +330,7 @@ public static Cloud.ObjectStoreInfoPB.Builder 
getObjStoreInfoPB(Map<String, Stri
             
builder.setExternalEndpoint(properties.get(S3Properties.EXTERNAL_ENDPOINT));
         }
         if (properties.containsKey(S3Properties.PROVIDER)) {
-            
builder.setProvider(Provider.valueOf(properties.get(S3Properties.PROVIDER)));
+            
builder.setProvider(Provider.valueOf(properties.get(S3Properties.PROVIDER).toUpperCase()));

Review Comment:
   ```suggestion
               // S3 Provider properties should be case insensitive.
               
builder.setProvider(Provider.valueOf(properties.get(S3Properties.PROVIDER).toUpperCase()));
   ```



##########
regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy:
##########
@@ -630,7 +630,7 @@ class Config {
             } else if (config.s3Source == "huawei") {
                 s3Provider = "OBS"
             } else if (config.s3Source == "azure") {
-                s3Provider = "AZURE"
+                s3Provider = "Azure"

Review Comment:
   ```suggestion
                   s3Provider = "Azure" // case insensitive test
   ```



##########
fe/fe-core/src/test/java/org/apache/doris/analysis/StageTest.java:
##########
@@ -103,7 +103,7 @@ public void testAnalyzeStorageProperties() throws Exception 
{
                 + "'prefix' = 'tmp_prefix', "
                 + "'provider' = 'abc', "
                 + "'ak'='tmp_ak', 'sk'='tmp_sk', 'access_type'='aksk');";
-        parseAndAnalyzeWithException(sql, "Property provider with invalid 
value abc");
+        parseAndAnalyzeWithException(sql, "Property provider with invalid 
value ABC");

Review Comment:
   ```suggestion
           // S3 Provider will be converted to upper case.
           parseAndAnalyzeWithException(sql, "Property provider with invalid 
value ABC");
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/LoadStmt.java:
##########
@@ -527,7 +527,7 @@ private String getProviderFromEndpoint() {
         Map<String, String> properties = brokerDesc.getProperties();
         for (Map.Entry<String, String> entry : properties.entrySet()) {
             if (entry.getKey().equalsIgnoreCase(S3Properties.PROVIDER)) {
-                return entry.getValue();
+                return entry.getValue().toUpperCase();

Review Comment:
   ```suggestion
                   // S3 Provider properties should be case insensitive.
                   return entry.getValue().toUpperCase();
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/constants/S3Properties.java:
##########
@@ -197,7 +197,7 @@ public static Map<String, String> 
requiredS3TVFProperties(Map<String, String> pr
     private static void checkProvider(Map<String, String> properties) throws 
DdlException {
         if (properties.containsKey(PROVIDER)) {
             properties.put(PROVIDER, properties.get(PROVIDER).toUpperCase());
-            if (!PROVIDERS.stream().anyMatch(s -> 
s.equals(properties.get(PROVIDER)))) {
+            if (!PROVIDERS.stream().anyMatch(s -> 
s.equals(properties.get(PROVIDER).toUpperCase()))) {

Review Comment:
   ```suggestion
               // S3 Provider properties should be case insensitive.
               if (!PROVIDERS.stream().anyMatch(s -> 
s.equals(properties.get(PROVIDER).toUpperCase()))) {
   ```



-- 
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