Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable UpsertCompactMergeTask with enableDeletedKeysCompactionConsistency config #14796

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private TableConfigUtils() {

// supported TableTaskTypes, must be identical to the one return in the impl of {@link PinotTaskGenerator}.
private static final String UPSERT_COMPACTION_TASK_TYPE = "UpsertCompactionTask";
private static final String UPSERT_COMPACT_MERGE_TASK_TYPE = "UpsertCompactMergeTask";

// this is duplicate with KinesisConfig.STREAM_TYPE, while instead of use KinesisConfig.STREAM_TYPE directly, we
// hardcode the value here to avoid pulling the entire pinot-kinesis module as dependency.
Expand Down Expand Up @@ -760,11 +761,13 @@ static void validateUpsertAndDedupConfig(TableConfig tableConfig, Schema schema)
Preconditions.checkState(upsertConfig.isEnableSnapshot(),
"enableDeletedKeysCompactionConsistency should exist with enableSnapshot for upsert table");

// enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask
// enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask / UpsertCompactMergeTask
TableTaskConfig taskConfig = tableConfig.getTaskConfig();
Preconditions.checkState(
taskConfig != null && taskConfig.getTaskTypeConfigsMap().containsKey(UPSERT_COMPACTION_TASK_TYPE),
"enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask for upsert table");
Preconditions.checkState(taskConfig != null
&& (taskConfig.getTaskTypeConfigsMap().containsKey(UPSERT_COMPACTION_TASK_TYPE)
|| taskConfig.getTaskTypeConfigsMap().containsKey(UPSERT_COMPACT_MERGE_TASK_TYPE)),
"enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask"
+ " / UpsertCompactMergeTask for upsert table");
}

if (upsertConfig.getConsistencyMode() != UpsertConfig.ConsistencyMode.NONE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ public void testValidateUpsertConfig() {
"enableDeletedKeysCompactionConsistency should exist with enableSnapshot for upsert table");
}

// test enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask
// test enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask / UpsertCompactMerge task
upsertConfig = new UpsertConfig(UpsertConfig.Mode.FULL);
upsertConfig.setEnableDeletedKeysCompactionConsistency(true);
upsertConfig.setDeletedKeysTTL(100);
Expand All @@ -2080,7 +2080,8 @@ public void testValidateUpsertConfig() {
TableConfigUtils.validateUpsertAndDedupConfig(tableConfig, schema);
} catch (IllegalStateException e) {
Assert.assertEquals(e.getMessage(),
"enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask for upsert table");
"enableDeletedKeysCompactionConsistency should exist with UpsertCompactionTask "
+ "/ UpsertCompactMergeTask for upsert table");
}
}

Expand Down
Loading