Skip to content
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

remove unalias TableScan filters when create Physical Filter #8404

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

jackwener
Copy link
Member

Which issue does this PR close?

Closes #.

Rationale for this change

  • remove unalias TableScan filters
  • refactor CreateExternalTable
  • fix typo

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added physical-expr Physical Expressions core Core DataFusion crate labels Dec 3, 2023
@@ -562,8 +562,7 @@ impl DefaultPhysicalPlanner {
// doesn't know (nor should care) how the relation was
// referred to in the query
let filters = unnormalize_cols(filters.iter().cloned());
let unaliased: Vec<Expr> = filters.into_iter().map(unalias).collect();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's useless

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have to rely on our test coverage here, and given all the existing tests pass I agree!

Copy link
Member Author

@jackwener jackwener Dec 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, existing tests already cover it.
BTW, theoretically and in terms of code, the alias in the filter expression does not affect the schema or output.

@jackwener jackwener changed the title remove unalias TableScan filters remove unalias TableScan filters in create PhysicalPlan Dec 3, 2023
@jackwener jackwener changed the title remove unalias TableScan filters in create PhysicalPlan remove unalias TableScan filters when create Physical Filter Dec 3, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jackwener -- this is a very nice PR 👏

@@ -562,8 +562,7 @@ impl DefaultPhysicalPlanner {
// doesn't know (nor should care) how the relation was
// referred to in the query
let filters = unnormalize_cols(filters.iter().cloned());
let unaliased: Vec<Expr> = filters.into_iter().map(unalias).collect();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have to rely on our test coverage here, and given all the existing tests pass I agree!

@jackwener jackwener merged commit 26196e6 into apache:main Dec 3, 2023
24 checks passed
@jackwener jackwener deleted the refactor_code branch December 3, 2023 13:44
appletreeisyellow pushed a commit to appletreeisyellow/datafusion that referenced this pull request Dec 14, 2023
…che#8404)

- remove `unalias` TableScan filters
- refactor  CreateExternalTable
- fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants