Skip to content

Commit

Permalink
Minor: simplify filter statistics code (#8174)
Browse files Browse the repository at this point in the history
* Minor: simplify filter statistics code

* remove comment
  • Loading branch information
alamb authored Nov 15, 2023
1 parent 841a9a6 commit e1c2f95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions datafusion/core/src/physical_optimizer/join_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 2 additions & 8 deletions datafusion/physical-plan/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
},
)
Expand Down

0 comments on commit e1c2f95

Please sign in to comment.