linrrzqqq commented on code in PR #67673:
URL: https://github.com/apache/doris/pull/67673#discussion_r3970980690


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/constants/AIProperties.java:
##########
@@ -97,6 +96,30 @@ public static void requiredAIProperties(Map<String, String> 
properties) throws D
         }
     }
 
+    private static boolean hasAnyProperty(Map<String, String> properties, 
List<String> requiredFields,
+            String apiKeyField) {
+        return properties.containsKey(apiKeyField) || 
requiredFields.stream().anyMatch(properties::containsKey);
+    }
+
+    private static void validatePropertyGroup(Map<String, String> properties, 
List<String> requiredFields,
+            String providerTypeField, String apiKeyField) throws DdlException {
+        for (String field : requiredFields) {
+            if (Strings.isNullOrEmpty(properties.get(field))) {
+                throw new DdlException("Missing [" + field + "] in 
properties.");
+            }
+        }
+
+        String providerType = properties.get(providerTypeField).toUpperCase();
+        properties.put(providerTypeField, providerType);

Review Comment:
   dismiss



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