-
Notifications
You must be signed in to change notification settings - Fork 1.9k
FilterExec should remap indices of parent dynamic filters #20286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
nice fix! I was working on the same #20283! I'll close mine as this already contains tests! |
adriangb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great fix!
|
Merging to get the fix in soon. @jackkleeman I wonder if we can reproduce this from an SLT test? Do you have a shape of query that you first noticed this with? |
I struggled because the datasources seem to do a column name remapping and are tolerant of this type of mismatch? it makes me wonder if i should be doing column name remapping too in my tableprovider this shape should cover it |
I guess they are doing it to handle some cases and that makes them more resilient. In theory I'm not sure, maybe it's not needed. In practice it's probably a good safety net for you to do that as well. |
|
there might be an argument to disable that behaviour for the tests so that we catch these types of issues |
IIRC it exists to adapt logical to physical schemas, which is a real thing / not paving over bugs. I'd guess it happens in https://github.com/apache/datafusion/blob/main/datafusion/physical-expr-adapter/src/schema_rewriter.rs. |
Which issue does this PR close?
Rationale for this change
Parent dynamic filters should be remapped from input to output schema, otherwise the indices can be wrong
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
No