waynexia opened a new pull request #747:
URL: https://github.com/apache/arrow-datafusion/pull/747


   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   Related to #277 .
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is 
sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   This PR adds an optimization rule to remove unnecessary projection plans.
   
   We'll consider a projection as "unnecessary" if it only reorders columns 
(requires the same columns against its sub-plan) and is not the first 
projection.
   
   For the case where the sub-plan of a projection is a table scan, projection 
will be pushed down into the table scan plan as a `Vec<usize>` array. From the 
[documentation](https://github.com/apache/arrow-datafusion/blob/afe29bd3c6322db88936d5936db58ad1fb5c9ae2/datafusion/src/optimizer/projection_push_down.rs#L82-L83),
 this array should be ordered. So I keep the projection in this situation (test 
case `reorder_projection()`).
   


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