liukun4515 commented on code in PR #3470:
URL: https://github.com/apache/arrow-datafusion/pull/3470#discussion_r970756516
##########
datafusion/core/src/physical_plan/file_format/row_filter.rs:
##########
@@ -202,7 +202,18 @@ impl<'a> ExprRewriter for FilterCandidateBuilder<'a> {
fn mutate(&mut self, expr: Expr) -> Result<Expr> {
if let Expr::Column(Column { name, .. }) = &expr {
if self.file_schema.field_with_name(name).is_err() {
- return Ok(Expr::Literal(ScalarValue::Null));
+ // the column expr must be in the table schema
+ return match self.table_schema.field_with_name(name) {
Review Comment:
If the expr matched the `Expr::Column`, it must be matched to a column in
the table schema.
So we don't need to push it to higher level and rewrite the binary
expression.
Just like the table schema is `c1,c2,c3`, and file1 is `c1,c2`, the file2
is `c1,c3`, we use the filter c3 < 10.
Then we will produce the c3< 10 for file2, and NULL(with data type of c3) <
10.
@thinkharderdev
--
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]