osipovartem opened a new pull request, #25243: URL: https://github.com/apache/datafusion/pull/25243
## Which issue does this PR close? Closes a planner gap where `ORDER BY ALL` only accepted raw column projections and was silently ignored for set-operation outputs. ## Rationale for this change `ORDER BY ALL` means sorting by every output column in select-list order. Expanding it to the equivalent 1-based ordinal keys supports computed expressions, aliases, aggregate outputs, wildcard-expanded projections, and set-operation outputs through one planner path. The ordinal expansion also sorts already-projected columns rather than evaluating computed expressions again. Physical execution remains on DataFusion's existing vectorized `SortExec`; this adds no row-wise conversion or custom physical operator. ## What changes are included? - expand `OrderByKind::All` to ordinal `OrderByExpr`s from the output width - provide output width for non-`SELECT` set expressions instead of dropping `ORDER BY ALL` - add focused execution coverage for computed expressions, null-order options, set operations, and aggregate output ## Are these changes tested? - `cargo +1.95.0 test -p datafusion-sqllogictest --test sqllogictests -- order_by_all.slt --test-threads 1` - `cargo +1.95.0 test -p datafusion-sql --test sql_integration -- --test-threads 8` (591 passed) - `cargo +1.95.0 clippy -p datafusion-sql --all-targets -- -D warnings` - `cargo +1.95.0 fmt --all -- --check` Snowflake dialect parsing support is proposed independently in apache/datafusion-sqlparser-rs#2502; this planner change is generic to every dialect that already emits `OrderByKind::All`. -- 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]
