github-actions[bot] commented on code in PR #62619:
URL: https://github.com/apache/doris/pull/62619#discussion_r3129110258
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowAlterTableCommand.java:
##########
@@ -142,12 +144,18 @@ private void getPredicateValue(Expression subExpr,
boolean isNotExpr) throws Ana
Expression right =
subExpr.child(1).castTo(Config.enable_date_conversion
? DateTimeV2Type.MAX : DateTimeType.INSTANCE);
subExpr = subExpr.withChildren(left, right);
+ Expression filterExpr = isNotExpr ? new Not(subExpr) : subExpr;
+ Expression existingExpr = filterMap.get(leftKey);
+ if (existingExpr == null) {
+ filterMap.put(leftKey, filterExpr);
+ } else {
+ filterMap.put(leftKey, ExpressionUtils.and(existingExpr,
filterExpr));
+ }
} else {
Review Comment:
This only merges repeated predicates for `CreateTime`/`FinishTime`. Repeated
predicates on the other supported keys are still overwritten in the map, so a
query like `SHOW ALTER TABLE COLUMN FROM db WHERE State = "RUNNING" AND State =
"FINISHED"` will keep only the second `State` predicate and incorrectly return
`FINISHED` jobs instead of no rows. Since the proc layer now evaluates
`And`/`Not`, can we combine same-key predicates for
`TableName`/`State`/`IndexName`/`BaseIndexName`/`RollupIndexName` too (or
reject duplicates explicitly)? The same hole exists in `ShowBuildIndexCommand`.
--
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]