Asthenia0412 commented on PR #19866: URL: https://github.com/apache/pinot/pull/19866#issuecomment-6169506134
Hi @xiangfu0, This PR fixes #19701: single-stage selection queries with ORDER BY literals (e.g. `ORDER BY 2`) or constant-folded functions (e.g. `ORDER BY now()`) incorrectly enter the partial-order optimization path, which requires the first ORDER BY expression to be an IDENTIFIER. The fix is a one-line change in `SelectionPlanNode.isSorted()`: LITERAL expressions now return `false` instead of `true`. Literals aren't bound to any data source column, so they can't leverage segment's natural sort order anyway — the query automatically falls through to the correct `SelectionOrderByOperator` path. Behavior change: only for queries with ORDER BY starting with a literal. Normal ORDER BY identifier queries are unaffected. Would appreciate your review. Thanks! -- 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]
