Skip to content

fix: reassign_predicate_columns w/ in-list expr - #6114

Merged
alamb merged 1 commit into
apache:mainfrom
crepererum:crepererum/reassign_predicate_columns_inlist
Apr 25, 2023
Merged

alamb merged 1 commit into
apache:mainfrom
crepererum:crepererum/reassign_predicate_columns_inlist

Conversation

@crepererum

@crepererum crepererum commented Apr 25, 2023 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

LGTM

@mingmwang

mingmwang commented Apr 25, 2023 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@mingmwang

Copy link
Copy Markdown
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
Copy Markdown
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

alamb commented Apr 25, 2023

Copy link
Copy Markdown
Contributor

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