saurabhd336 commented on code in PR #8708:
URL: https://github.com/apache/pinot/pull/8708#discussion_r886539092


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -505,34 +505,40 @@ static void validateTaskConfigs(TableConfig tableConfig, 
Schema schema) {
    *  - comparison column exists
    */
   @VisibleForTesting
-  static void validateUpsertConfig(TableConfig tableConfig, Schema schema) {
-    if (tableConfig.getUpsertMode() == UpsertConfig.Mode.NONE) {
+  static void validateUpsertAndDedupConfig(TableConfig tableConfig, Schema 
schema) {
+    if (tableConfig.getUpsertMode() == UpsertConfig.Mode.NONE && 
tableConfig.getDedupConfig() == null) {
       return;
     }
     // check table type is realtime
     Preconditions
-        .checkState(tableConfig.getTableType() == TableType.REALTIME, "Upsert 
table is for realtime table only.");
+        .checkState(tableConfig.getTableType() == TableType.REALTIME, 
"Upsert/Dedup table is for realtime table only.");
     // primary key exists
     
Preconditions.checkState(CollectionUtils.isNotEmpty(schema.getPrimaryKeyColumns()),
-        "Upsert table must have primary key columns in the schema");
+        "Upsert/Dedup table must have primary key columns in the schema");
     // consumer type must be low-level
     Map<String, String> streamConfigsMap = 
IngestionConfigUtils.getStreamConfigMap(tableConfig);
     StreamConfig streamConfig = new StreamConfig(tableConfig.getTableName(), 
streamConfigsMap);
     Preconditions.checkState(streamConfig.hasLowLevelConsumerType() && 
!streamConfig.hasHighLevelConsumerType(),
-        "Upsert table must use low-level streaming consumer type");
+        "Upsert/Dedup table must use low-level streaming consumer type");
     // replica group is configured for routing
     Preconditions.checkState(
         tableConfig.getRoutingConfig() != null && 
RoutingConfig.STRICT_REPLICA_GROUP_INSTANCE_SELECTOR_TYPE
             
.equalsIgnoreCase(tableConfig.getRoutingConfig().getInstanceSelectorType()),
-        "Upsert table must use strict replica-group (i.e. strictReplicaGroup) 
based routing");
-    // no startree index
-    Preconditions.checkState(
-        
CollectionUtils.isEmpty(tableConfig.getIndexingConfig().getStarTreeIndexConfigs())
 && !tableConfig
-            .getIndexingConfig().isEnableDefaultStarTree(), "The upsert table 
cannot have star-tree index.");
-    // comparison column exists
-    if (tableConfig.getUpsertConfig().getComparisonColumn() != null) {
-      String comparisonCol = 
tableConfig.getUpsertConfig().getComparisonColumn();
-      Preconditions.checkState(schema.hasColumn(comparisonCol), "The 
comparison column does not exist on schema");
+        "Upsert/Dedup table must use strict replica-group (i.e. 
strictReplicaGroup) based routing");
+
+    // specifically for upsert
+    if (tableConfig.getUpsertConfig() != null) {

Review Comment:
   Ack



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