Jefffrey commented on code in PR #24541:
URL: https://github.com/apache/datafusion/pull/24541#discussion_r3826690624
##########
datafusion/common/src/config.rs:
##########
@@ -748,6 +748,94 @@ impl Display for ConfigMinTwoUsize {
}
}
+/// A `u8` configuration value that rejects values greater than 100 when set
+/// from strings.
+///
+/// Use this for options that represent a percentage, such as
+/// [`OptimizerOptions::default_filter_selectivity`]. Without this, an
+/// out-of-range value (e.g. 200) is silently accepted at `SET` time and only
+/// rejected later, when the value is actually consumed (e.g. by
+/// `FilterExec`).
Review Comment:
```suggestion
/// Used for [`OptimizerOptions::default_filter_selectivity`] to represent
/// an integer percentage value, when valid values are 0 to 100 inclusive.
```
##########
datafusion/common/src/config.rs:
##########
@@ -748,6 +748,94 @@ impl Display for ConfigMinTwoUsize {
}
}
+/// A `u8` configuration value that rejects values greater than 100 when set
+/// from strings.
+///
+/// Use this for options that represent a percentage, such as
+/// [`OptimizerOptions::default_filter_selectivity`]. Without this, an
+/// out-of-range value (e.g. 200) is silently accepted at `SET` time and only
+/// rejected later, when the value is actually consumed (e.g. by
+/// `FilterExec`).
+#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct ConfigFilterSelectivity(u8);
Review Comment:
do we have any other configs that could benefit from this? that way we might
rename this to something more generic
--
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]