xudong963 commented on code in PR #21081:
URL: https://github.com/apache/datafusion/pull/21081#discussion_r3062589133
##########
datafusion/physical-plan/src/joins/utils.rs:
##########
@@ -708,7 +708,13 @@ fn max_distinct_count(
stats: &ColumnStatistics,
) -> Precision<usize> {
match &stats.distinct_count {
- &dc @ (Precision::Exact(_) | Precision::Inexact(_)) => dc,
+ &dc @ (Precision::Exact(_) | Precision::Inexact(_)) => {
+ // NDV can never exceed the number of rows
+ match num_rows {
+ Precision::Absent => dc,
+ _ => dc.min(num_rows).to_inexact(),
Review Comment:
do we want the unconditional `.to_inexact()`?
##########
datafusion/physical-plan/src/filter.rs:
##########
@@ -781,6 +782,7 @@ fn collect_new_statistics(
schema: &SchemaRef,
input_column_stats: &[ColumnStatistics],
analysis_boundaries: Vec<ExprBoundaries>,
+ filtered_num_rows: Option<usize>,
Review Comment:
do we need to give it a precision info? -- `Option<Precision<usize>>`
--
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]