tibrewalpratik17 commented on code in PR #12346:
URL: https://github.com/apache/pinot/pull/12346#discussion_r1475204057


##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/upsertcompaction/UpsertCompactionTaskGenerator.java:
##########
@@ -124,9 +127,27 @@ public List<PinotTaskConfig> 
generateTasks(List<TableConfig> tableConfigs) {
 
       // TODO: currently, we put segmentNames=null to get metadata for all 
segments. We can change this to get
       // valid doc id metadata in batches with the loop.
+      String validDocIdType =
+          taskConfigs.getOrDefault(UpsertCompactionTask.VALID_DOC_ID_TYPE, 
DEFAULT_VALID_DOC_ID_TYPE);
+
+      // Validate that the snapshot is enabled if validDocIdType is 
validDocIdsSnapshot
+      if (validDocIdType.equals(DEFAULT_VALID_DOC_ID_TYPE)) {
+        UpsertConfig upsertConfig = tableConfig.getUpsertConfig();
+        Preconditions.checkNotNull(upsertConfig, "UpsertConfig must be 
provided for UpsertCompactionTask");
+        Preconditions.checkState(upsertConfig.isEnableSnapshot(), 
String.format(
+            "'enableSnapshot' from UpsertConfig must be enabled for 
UpsertCompactionTask with validDocIdType = %s",
+            validDocIdType));
+      } else if (validDocIdType.equals("queryableDocIds")) {
+        UpsertConfig upsertConfig = tableConfig.getUpsertConfig();
+        Preconditions.checkNotNull(upsertConfig, "UpsertConfig must be 
provided for UpsertCompactionTask");
+        Preconditions.checkNotNull(upsertConfig.getDeleteRecordColumn(),
+            String.format("deleteRecordColumn must be provided for " + 
"UpsertCompactionTask with validDocIdType = %s",
+                validDocIdType));
+      }

Review Comment:
   Ah nvm! My bad! This is fine! 



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