2010YOUY01 commented on code in PR #24541:
URL: https://github.com/apache/datafusion/pull/24541#discussion_r3826914646


##########
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:
   Probably we can generalize it to a 
   ```
   pub struct ConfigRangeUsize {
       inclusive_min: usize,
       /// `None` if there is no maximum limit.
       inclusive_max: Option<usize>,
   }
   ```
   
   And several existing typed config structs can reuse this one (like 
`ConfigNonZeroUsize`)
   
   But I think this is not blocking, we can clean it up in a follow-up PR



-- 
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]

Reply via email to