viirya commented on code in PR #9223:
URL: https://github.com/apache/arrow-datafusion/pull/9223#discussion_r1527203388


##########
datafusion/core/src/physical_optimizer/pruning.rs:
##########
@@ -903,6 +1004,42 @@ impl<'a> PruningExpressionBuilder<'a> {
         self.required_columns
             .max_column_expr(&self.column, &self.column_expr, self.field)
     }
+
+    /// Note that this function intentionally overwrites the column expression 
to [`phys_expr::Column`].
+    /// i.e. expressions like [`phys_expr::CastExpr`] or 
[`phys_expr::TryCastExpr`] will be overwritten.
+    ///
+    /// This is to avoid cases like `cast(x_null_count)` or 
`try_cast(x_null_count)`.

Review Comment:
   I checked how this function is used below. I think it is not used to rewrite 
predicate expression. It is to actually simply retune the null_count physical 
expression no matter the predicate expression is.



-- 
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]

Reply via email to