viirya commented on a change in pull request #1595:
URL: https://github.com/apache/arrow-datafusion/pull/1595#discussion_r787107996
##########
File path: datafusion/src/physical_optimizer/pruning.rs
##########
@@ -657,13 +696,23 @@ fn build_statistics_expr(expr_builder: &mut
PruningExpressionBuilder) -> Result<
.or(expr_builder.scalar_expr().clone().not_eq(max_column_expr))
}
Operator::Eq => {
- // column = literal => (min, max) = literal => min <= literal
&& literal <= max
- // (column / 2) = 4 => (column_min / 2) <= 4 && 4 <=
(column_max / 2)
- let min_column_expr = expr_builder.min_column_expr()?;
- let max_column_expr = expr_builder.max_column_expr()?;
- min_column_expr
- .lt_eq(expr_builder.scalar_expr().clone())
-
.and(expr_builder.scalar_expr().clone().lt_eq(max_column_expr))
+ if expr_builder
+ .scalar_expr_value()
+ .map(|s| s.is_null())
+ .unwrap_or(false)
+ {
+ // column = null => null_count > 0
+ let null_count_column_expr =
expr_builder.null_count_column_expr()?;
+ null_count_column_expr.gt(lit::<i64>(0))
Review comment:
Oh, you're right. This should be `u64`.
--
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]