saadtajwar opened a new pull request, #27305: URL: https://github.com/apache/datafusion/pull/27305
## Which issue does this PR close? - Closes #24761 ## Rationale for this change `ReplaceFilterTop1` rewrites `Filter(row_number() = 1)` over a `PARTITION BY` window into a `first_value` aggregate - the rewrite was gated behind `datafusion.optimizer.enable_row_number_to_aggregate`, which defaulted to `false` - this PR enables this by default ## What changes are included in this PR? - Set `enable_row_number_to_aggregate` default to `true` in `datafusion/common/src/config.rs` and remove the “disabled by default” documentation on that option. - Regenerate `docs/source/user-guide/configs.md` via `./dev/update_config_docs.sh`. - Update `information_schema.slt` expectations for the new default and description text. - Adjust `row_number_to_aggregate.slt` comments (default is enabled; tests still cover explicit opt-out). - Update the module doc on `ReplaceFilterTop1` to note the option is on by default. ## What is the testing strategy for this PR? - **Unit tests:** Existing `datafusion-optimizer` tests in `replace_filter_top1.rs` (including `no_rewrite_when_gate_disabled` with the gate off). - **SQL Logic Tests:** Updated `information_schema.slt` and `row_number_to_aggregate.slt`; the latter still exercises disabled vs enabled behavior via `SET`. - **Docs:** Generated `configs.md` matches `config.rs` (CI `check configs.md` / generated-docs checks). ## Are there user-facing changes? Yes, top-1 `row_number()` + `filter` patterns are rewritten to `first_value` aggregates unless the optimizer option is set to `false`. -- 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]
