Skip to content

fix: reassign_predicate_columns w/ in-list expr #6114

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

Merged

Conversation

crepererum
Copy link
Contributor

@crepererum crepererum commented Apr 25, 2023

Which issue does this PR close?

Related to upstream ticket https://github.com/influxdata/influxdb_iox/issues/7644

Rationale for this change

We need to also re-assign the schema stored within InListExpr at the same time when we replace the children.

This bug affects both the public API reassign_predicate_columns as well as potential internal use of it.

What changes are included in this PR?

Bugfix.

Are these changes tested?

New test.

Are there any user-facing changes?

-

We need to also re-assign the schema stored within `InListExpr` at the
same time when we replace the children.
@github-actions github-actions bot added the physical-expr Changes to the physical-expr crates label Apr 25, 2023
@mingmwang
Copy link
Contributor

LGTM

@mingmwang
Copy link
Contributor

mingmwang commented Apr 25, 2023

It is unrelated to this PR, but I think the original implementation of the reassign_predicate_columns() is strange, it should not leverage the transform() process to do the replacement if the schema is changed, because thetransform() process assumes the schema of the expr will not change.

@mingmwang
Copy link
Contributor

There are some other physical Exprs which might be schema aware.

@mingmwang
Copy link
Contributor

I think we should remove the input schema from those phyiscal Exprs, and move the type check in the physical expression planner.

@mingmwang
Copy link
Contributor

My bad, looks like the input_schema: Schema in InListExpr was added by me in this PR
[Part1] Partition and Sort Enforcement, PhysicalExpr enhancement (#3969)

I will file a FOLLOWUP ticket to remove the input_schema in this and other physical exprs and move the validation logic to the physical expression planner. So that you do not need a specific handling on InListExpr to re-assign a schema.

@alamb
Copy link
Contributor

alamb commented Apr 25, 2023

Thank you @crepererum and @mingmwang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Changes to the physical-expr crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants