itsjunetime commented on code in PR #11994:
URL: https://github.com/apache/datafusion/pull/11994#discussion_r1718844856
##########
datafusion/core/src/datasource/physical_plan/parquet/row_filter.rs:
##########
@@ -243,13 +295,17 @@ impl<'a> TreeNodeRewriter for FilterCandidateBuilder<'a> {
Ok(Transformed::no(node))
}
+ /// After visiting all children, rewrite column references to nulls if
+ /// they are not in the file schema
fn f_up(
&mut self,
expr: Arc<dyn PhysicalExpr>,
) -> Result<Transformed<Arc<dyn PhysicalExpr>>> {
+ // if the expression is a column, is it in the file schema?
if let Some(column) = expr.as_any().downcast_ref::<Column>() {
if self.file_schema.field_with_name(column.name()).is_err() {
- // the column expr must be in the table schema
+ // Replace the column reference with a NULL (using the type
from the table schema)
+ // e.g. `column = 'foo'` is rewritten be transformed to `NULL
= 'foo'`
Review Comment:
This is obviously a much better comment than before, but I think it could be
further improved with an explanation stating why we do this column rewriting,
or what purpose it serves.
--
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]