alamb commented on code in PR #11483:
URL: https://github.com/apache/datafusion/pull/11483#discussion_r1679347111


##########
datafusion/core/src/physical_optimizer/pruning.rs:
##########
@@ -736,12 +738,22 @@ impl RequiredColumns {
         Self::default()
     }
 
-    /// Returns number of unique columns
-    pub(crate) fn n_columns(&self) -> usize {
-        self.iter()
-            .map(|(c, _s, _f)| c)
-            .collect::<HashSet<_>>()
-            .len()
+    /// Returns Some(column) if this is a single column predicate.

Review Comment:
   this was an easier API to work with
   
   update: and @Dandandan 's suggestion I think has made it faster (avoids the 
HashSet)



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