jonathanc-n opened a new pull request, #17651:
URL: https://github.com/apache/datafusion/pull/17651

   ## 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.
   -->
   
   Part of fix for #16488
   
   ## Changes
   Root cause
   
   During decorrelation of an exists subquery into a LeftMark join, the inner 
side still carries the literal from 'select 1'. The schema looks like this:
   
   `right = Projection: [Int64(1), x.b]`
   
   Projection Pushdown later drops the unused constant and rewrites the right 
child to just [x.b]. That “drop the first column” step shifts right-side column 
indices (from b@1 to b@0). During projection mapping it still assumes the old 
index (often doing “offset by left_width” and not accounting for the mark 
column), so when it re-indexes into the child it points at the wrong slot 
(which is what hit the error)
   
   The test is added to slt.


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

Reply via email to