xiangfu0 commented on code in PR #18549:
URL: https://github.com/apache/pinot/pull/18549#discussion_r3279117115


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/upload/SegmentValidationUtils.java:
##########
@@ -57,6 +84,206 @@ public static void validateTimeInterval(SegmentMetadata 
segmentMetadata, TableCo
     }
   }
 
+  public static void validateUpsertSegmentPartitionMetadata(SegmentMetadata 
segmentMetadata, TableConfig tableConfig) {
+    if (!isOfflineUpsertTable(tableConfig)) {
+      return;
+    }
+
+    String tableNameWithType = tableConfig.getTableName();
+    Map<String, ColumnPartitionConfig> columnPartitionMap = 
getColumnPartitionMap(tableConfig);
+    String partitionColumn = getPartitionColumn(segmentMetadata, tableConfig, 
tableNameWithType, columnPartitionMap);
+    validateNoExtraPartitionMetadataColumns(segmentMetadata, 
tableNameWithType, partitionColumn);
+    validateSinglePartition(segmentMetadata, tableNameWithType, 
partitionColumn, columnPartitionMap);
+  }

Review Comment:
   Intentionally keeping this as table-config validation instead of 
segment-upload validation. Table create/update now owns table-level 
offline-upsert checks such as exactly one segmentPartitionConfig column and 
primary-key membership. Upload validation only resolves the effective OFFLINE 
partition column and its partition function/config, then validates the uploaded 
segment metadata against that minimal config. If that minimal validation config 
cannot be resolved, upload fails closed with 400 BAD_REQUEST.



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