Jackie-Jiang opened a new pull request, #20134: URL: https://github.com/apache/pinot/pull/20134
Single-stage selection can throw when `ORDER BY` contains only literals, including constant-folded `now()`. Leading literals can also select the wrong scan direction: `ORDER BY 'constant' DESC, sorted_col ASC` should use the column's ascending order. Ignore literals when deriving the sorted prefix's direction and validating the partial-order operators. A literal-only prefix imposes no input-order requirement. Completely constant ordering uses the linear operator and stops after `LIMIT + OFFSET` rows; a nonconstant suffix is still sorted. Keep the original query expressions and ordered-result handling so projection, broker merging, and `OFFSET` retain their existing behavior. Fixes #19701. Alternative to #19702. Validation: - Confirmed all 12 new parameterized cases fail on the original implementation with constructor or direction errors, then pass with the fix. Coverage includes ordinal and explicit `now()` ordering, opposite literal/column directions, literal-only prefixes with unsorted columns/functions, late projection, empty results, and offsets near the end of the result set, with null handling and reverse scans both enabled and disabled. - 59 tests passed across `InnerSegmentSelectionSingleValueQueriesTest`, `LinearSelectionOrderByOperatorTest`, `SelectionOrderByOperatorTest`, `SelectionOperatorUtilsTest`, `SelectionOperatorServiceTest`, and `SelectionCombineOperatorTest` using JDK 25 and `./mvnw -pl pinot-core -am -Dsurefire.failIfNoSpecifiedTests=false test -Ppinot-fastdev` with the six classes selected by `-Dtest`. Compilation used `-Dmaven.compiler.showDeprecation=true -Dmaven.compiler.showWarnings=true`; no warnings on changed lines. - `spotless:apply`, `checkstyle:check`, `license:format`, and `license:check` passed for `pinot-core`. -- 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]
