walterddr commented on a change in pull request #7921:
URL: https://github.com/apache/pinot/pull/7921#discussion_r775052071



##########
File path: 
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java
##########
@@ -90,20 +100,34 @@ private TableConfigUtils() {
    *
    * TODO: Add more validations for each section (e.g. validate conditions are 
met for aggregateMetrics)
    */
-  public static void validate(TableConfig tableConfig, @Nullable Schema 
schema) {
+  public static void validate(TableConfig tableConfig, @Nullable Schema 
schema, @Nullable String typesToSkip) {
+    List<ValidationType> skipTypes = parseTypesToSkipString(typesToSkip);
     if (tableConfig.getTableType() == TableType.REALTIME) {
       Preconditions.checkState(schema != null, "Schema should not be null for 
REALTIME table");
     }
     // Sanitize the table config before validation
     sanitize(tableConfig);
-    validateValidationConfig(tableConfig, schema);
-    validateIngestionConfig(tableConfig, schema);
-    validateTierConfigList(tableConfig.getTierConfigsList());
-    validateIndexingConfig(tableConfig.getIndexingConfig(), schema);
-    validateFieldConfigList(tableConfig.getFieldConfigList(), 
tableConfig.getIndexingConfig(), schema);
-    validateUpsertConfig(tableConfig, schema);
-    validatePartialUpsertStrategies(tableConfig, schema);
-    validateTaskConfigs(tableConfig, schema);
+    // skip all validation if skip type ALL is selected. 
+    if (!skipTypes.contains(ValidationType.ALL)) {
+      validateValidationConfig(tableConfig, schema);
+      validateIngestionConfig(tableConfig, schema);
+      validateTierConfigList(tableConfig.getTierConfigsList());
+      validateIndexingConfig(tableConfig.getIndexingConfig(), schema);
+      validateFieldConfigList(tableConfig.getFieldConfigList(), 
tableConfig.getIndexingConfig(), schema);
+      if (!skipTypes.contains(ValidationType.UPSERT)) {
+        validateUpsertConfig(tableConfig, schema);
+        validatePartialUpsertStrategies(tableConfig, schema);
+      }
+      if (!skipTypes.contains(ValidationType.TASK)) {
+        validateTaskConfigs(tableConfig, schema);
+      }
+    }
+  }
+
+  private static List<ValidationType> parseTypesToSkipString(String 
typesToSkip) {
+    return typesToSkip == null ? Collections.emptyList() : 
Arrays.stream(typesToSkip.split(","))

Review comment:
       done for case correction; not sure if we need whitespace since it is 
passed in via query param on URLs, usually they dont have whitespaces. will add 
if needed




-- 
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...@pinot.apache.org

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



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

Reply via email to