asolimando commented on code in PR #27620:
URL: https://github.com/apache/datafusion/pull/27620#discussion_r4671329592


##########
datafusion/common/src/functional_dependencies.rs:
##########
@@ -22,6 +24,24 @@ pub enum Constraint {
     Unique(Vec<usize>),
 }
 
+impl Constraint {
+    /// Returns `true` if the constraint columns identify a row also when NULL
+    /// values are treated as equal, as when sorting: always for a primary key,
+    /// and for a unique key only if none of its columns is nullable in
+    /// `schema`. See [`FunctionalDependence::is_valid_across_nulls`].
+    pub fn is_valid_across_nulls(&self, schema: &Schema) -> bool {

Review Comment:
   Thanks, I have adopted the suggest with a slight change (renamed it to 
`implies_unique_sort_prefix` as it is already a method on `Constraint`), added 
your example to its doc, and documented on `Constraint::Unique` that key 
columns may be `NULL`



##########
datafusion/common/src/functional_dependencies.rs:
##########
@@ -22,6 +24,24 @@ pub enum Constraint {
     Unique(Vec<usize>),
 }
 
+impl Constraint {
+    /// Returns `true` if the constraint columns identify a row also when NULL
+    /// values are treated as equal, as when sorting: always for a primary key,
+    /// and for a unique key only if none of its columns is nullable in
+    /// `schema`. See [`FunctionalDependence::is_valid_across_nulls`].
+    pub fn is_valid_across_nulls(&self, schema: &Schema) -> bool {

Review Comment:
   That's true, I have added `#[doc(hidden)]` plus the internal-use section, 
thanks!



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