pepijnve opened a new pull request, #17419: URL: https://github.com/apache/datafusion/pull/17419
## Which issue does this PR close? - Closes #17411 ## Rationale for this change The documentation states that `WITH ORDER` clauses may use non-trivial expressions. It even has an example showing the usage of this feature. In practice this does not work and the implementation is limited to simple column references. ## What changes are included in this PR? - Add a new `physical_expr::create_lex_ordering` function that provides a more flexible version of `physical_expr::create_ordering` - Add a new `physical_expr::project` function that rewrites physical expressions for projected schemas - Remove the column assumption from `FileScanConfig::get_projected_output_ordering` using `physical_expr::project` ## Are these changes tested? Still in progress ## Are there any user-facing changes? - The example in the documentation will now actually work - Consumers of sort expressions may now have to deal with arbitrary `PhysicalExpr` instances rather than only `Column`. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org