subhramit opened a new pull request, #24541: URL: https://github.com/apache/datafusion/pull/24541
## Which issue does this PR close? Part of https://github.com/apache/datafusion/issues/17498 ## Rationale for this change `datafusion.optimizer.default_filter_selectivity` is [documented](https://datafusion.apache.org/user-guide/configs.html#via-sql) as a percentage in the range 0 (no selectivity) and 100 (all rows are selected), but invalid values such as 200 are currently accepted by `SET` and only rejected later when the value is actually consumed during physical planning / execution. So validating and rejecting out-of-range values at `SET` time to give users immediate feedback. ## What changes are included in this PR? - Add a validated `ConfigFilterSelectivity` wrapper type in `datafusion/common/src/config.rs` - Change `optimizer.default_filter_selectivity` from `u8` to `ConfigFilterSelectivity` - Keep the default value validated via a dedicated helper used by `config_namespace!` - Update the physical planner to read the raw `u8` value via `.get()` - Add `sqllogictest` coverage showing that: - `SET datafusion.optimizer.default_filter_selectivity = 200` fails immediately - boundary values `0` and `100` are accepted ## Are these changes tested? Yes. The change is covered by `datafusion/sqllogictest/test_files/set_variable.slt`. Ran `cargo test --profile=ci --test sqllogictests -- set_variable.slt` to confirm it passes, and also ran `cargo test -p datafusion-cli` and `cargo test -p datafusion` to check for any related regressions. There were none. ## Are there any user-facing changes? Yes. As described above, users now get an immediate configuration error when setting `datafusion.optimizer.default_filter_selectivity` outside `0..=100`, instead of seeing a later failure when the value is consumed. This also changes a public config field type from `u8` to `ConfigFilterSelectivity`, so it should likely carry the `api change` label (I request any maintainer to add this). -- 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]
