This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new e1c2f95830 Minor: simplify filter statistics code (#8174)
e1c2f95830 is described below
commit e1c2f9583015db326b3439897376f14f6b83a99a
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Nov 15 12:49:31 2023 -0500
Minor: simplify filter statistics code (#8174)
* Minor: simplify filter statistics code
* remove comment
---
datafusion/core/src/physical_optimizer/join_selection.rs | 1 +
datafusion/physical-plan/src/filter.rs | 10 ++--------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/datafusion/core/src/physical_optimizer/join_selection.rs
b/datafusion/core/src/physical_optimizer/join_selection.rs
index 876a464257..a7ecd1ca65 100644
--- a/datafusion/core/src/physical_optimizer/join_selection.rs
+++ b/datafusion/core/src/physical_optimizer/join_selection.rs
@@ -95,6 +95,7 @@ fn supports_collect_by_size(
let Ok(stats) = plan.statistics() else {
return false;
};
+
if let Some(size) = stats.total_byte_size.get_value() {
*size != 0 && *size < collection_size_threshold
} else if let Some(row_count) = stats.num_rows.get_value() {
diff --git a/datafusion/physical-plan/src/filter.rs
b/datafusion/physical-plan/src/filter.rs
index 52bff880b1..597e1d523a 100644
--- a/datafusion/physical-plan/src/filter.rs
+++ b/datafusion/physical-plan/src/filter.rs
@@ -277,16 +277,10 @@ fn collect_new_statistics(
)
};
ColumnStatistics {
- null_count: match
input_column_stats[idx].null_count.get_value() {
- Some(nc) => Precision::Inexact(*nc),
- None => Precision::Absent,
- },
+ null_count:
input_column_stats[idx].null_count.clone().to_inexact(),
max_value,
min_value,
- distinct_count: match distinct_count.get_value() {
- Some(dc) => Precision::Inexact(*dc),
- None => Precision::Absent,
- },
+ distinct_count: distinct_count.to_inexact(),
}
},
)