github-actions[bot] commented on code in PR #64878:
URL: https://github.com/apache/doris/pull/64878#discussion_r3489094144
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AlterRoutineLoadCommand.java:
##########
@@ -329,21 +364,62 @@ private void checkDataSourceProperties() throws
UserException {
}
private void checkPartialUpdate() throws UserException {
- if (!isPartialUpdate) {
+ RoutineLoadJob job = Env.getCurrentEnv().getRoutineLoadManager()
+ .getJob(getDbName(), getJobName());
+ TUniqueKeyUpdateMode uniqueKeyUpdateMode =
getEffectiveUniqueKeyUpdateMode(job);
+ if (uniqueKeyUpdateMode == TUniqueKeyUpdateMode.UPSERT) {
return;
}
- RoutineLoadJob job = Env.getCurrentEnv().getRoutineLoadManager()
- .getJob(getDbName(), getDbName());
if (job.isMultiTable()) {
throw new AnalysisException("load by PARTIAL_COLUMNS is not
supported in multi-table load.");
}
Database db =
Env.getCurrentInternalCatalog().getDbOrAnalysisException(job.getDbFullName());
- Table table = db.getTableOrAnalysisException(job.getTableName());
- if (isPartialUpdate && !((OlapTable)
table).getEnableUniqueKeyMergeOnWrite()) {
+ String tableName = hasTargetTable() ? targetTableName :
job.getTableName();
+ Table table = db.getTableOrAnalysisException(tableName);
+ if (!((OlapTable) table).getEnableUniqueKeyMergeOnWrite()) {
throw new AnalysisException("load by PARTIAL_COLUMNS is only
supported in unique table MoW");
}
}
+ private TUniqueKeyUpdateMode
getEffectiveUniqueKeyUpdateMode(RoutineLoadJob job) {
+ if
(analyzedJobProperties.containsKey(CreateRoutineLoadInfo.UNIQUE_KEY_UPDATE_MODE))
{
Review Comment:
`checkPartialUpdate()` now trusts an explicit
`unique_key_update_mode=UPSERT` and returns before the MoW validation, but the
apply path does not preserve that same precedence.
`modifyCommonJobProperties()` first applies `unique_key_update_mode`, then
still consumes `partial_columns`; for
`PROPERTIES("unique_key_update_mode"="UPSERT", "partial_columns"="true")`, line
2110 turns the job into `UPDATE_FIXED_COLUMNS`. On a non-MoW table the
statement therefore succeeds even though the resulting job is a partial-update
job, and the next routine-load task will later fail planning with `Only unique
key merge on write support partial update`. Please make this helper compute the
same effective mode as the mutation path, or make the mutation path truly
ignore `partial_columns` when an explicit update mode is present, before
skipping the MoW check.
--
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]