xiangfu0 commented on code in PR #20134:
URL: https://github.com/apache/pinot/pull/20134#discussion_r4449786288
##########
pinot-common/src/main/java/org/apache/pinot/sql/parsers/rewriter/QueryRewriterFactory.java:
##########
@@ -38,10 +38,11 @@ private QueryRewriterFactory() {
// (reference) into the group-by list, but the alias should not be applied
to the reference.
// E.g. SELECT a + 1 AS a FROM table GROUP BY 1
// AggregationOptimizer should run early to optimize aggregation patterns
before other rewrites.
+ // OrderByLiteralRemover must run after OrdinalsUpdater so integer
ordinals are resolved before removing literals.
public static final List<String> DEFAULT_QUERY_REWRITERS_CLASS_NAMES =
List.of(CompileTimeFunctionsInvoker.class.getName(),
AggregationOptimizer.class.getName(),
SelectionsRewriter.class.getName(),
PredicateComparisonRewriter.class.getName(),
- AliasApplier.class.getName(), OrdinalsUpdater.class.getName(),
+ AliasApplier.class.getName(), OrdinalsUpdater.class.getName(),
OrderByLiteralRemover.class.getName(),
Review Comment:
**MINOR:** The fix now lives only in the default rewriter list, because
2f1fa8d7 reverted the planner changes. Clusters that set
`pinot.broker.query.rewriter.class.names` (required to enable
`ExprMinMaxRewriter`) or `pinot.server.query.rewriter.class.names` won't get
`OrderByLiteralRemover`, and `SelectionPlanNode` will still throw for those
queries. Consider a release note telling them to add it, or a small guard in
the planner.
--
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]