We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
single_column
1 parent 3024a8a commit 7886e29Copy full SHA for 7886e29
datafusion/core/src/physical_optimizer/pruning.rs
@@ -747,10 +747,13 @@ impl RequiredColumns {
747
/// * `a > 5 OR b < 10` returns `None`
748
/// * `true` returns None
749
pub(crate) fn single_column(&self) -> Option<&phys_expr::Column> {
750
- let cols = self.iter().map(|(c, _s, _f)| c).collect::<HashSet<_>>();
751
-
752
- if cols.len() == 1 {
753
- cols.iter().next().copied()
+ if self.columns.windows(2).all(|w| {
+ // check if all columns are the same (ignoring statistics and field)
+ let c1 = &w[0].0;
+ let c2 = &w[1].0;
754
+ c1 == c2
755
+ }) {
756
+ self.columns.first().map(|r| &r.0)
757
} else {
758
None
759
}
0 commit comments