haohuaijin commented on issue #8374:
URL: 
https://github.com/apache/arrow-datafusion/issues/8374#issuecomment-1848976739

   > My initial solution:
   > 
   > ```rust
   > .find_map(|(index, (projected_expr, alias))| {
   >   projected_expr.as_any().downcast_ref::<Column>().and_then(
   >       |projected_column| {
   >           (column.index() == projected_column.index()       <--- and index 
comparison
   >               && column.name().eq(projected_column.name()))
   >           .then(|| {
   >               state = RewriteState::RewrittenValid;
   >               Arc::new(Column::new(alias, index)) as _
   >           })
   >       },
   >   )
   > })
   > ```
   
   use name and index(the index is column index of input schema) to identify a 
column, should be under the assumption that the input schema of `column`'s plan 
and `projection_column`'s plan is the same. Otherwise, some projection that can 
be pushed down may become unable to be pushed down. And when the schema is the 
same, we can just use the index to identify a column.
   


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