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

[MINOR]: Update create_window_expr to refer only input schema #8945

Merged
merged 4 commits into from
Jan 24, 2024
Merged

[MINOR]: Update create_window_expr to refer only input schema #8945

merged 4 commits into from
Jan 24, 2024

Conversation

mustafasrepo
Copy link
Contributor

@mustafasrepo mustafasrepo commented Jan 22, 2024

Which issue does this PR close?

Closes #.

Rationale for this change

With the PR8920 create_window_expr function refers to window_schema to get its window expr output type. However, at this stage it should calculate its output type using input_schema. With this PR, function only refers to its input schema.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the core Core DataFusion crate label Jan 22, 2024
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 @mustafasrepo -- this makes sense to me. cc @comphead

@alamb
Copy link
Contributor

alamb commented Jan 23, 2024

I recommend we wait for another day to see if @comphead has any additional comments and then merge this PR

@@ -1552,10 +1549,10 @@ pub fn create_window_expr_with_name(
e: &Expr,
name: impl Into<String>,
logical_input_schema: &DFSchema,
physical_input_schema: &Schema,
Copy link
Contributor

@comphead comphead Jan 23, 2024

Choose a reason for hiding this comment

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

Thanks @mustafasrepo
I'm still thinking if we need to have a physical schema? This is misleading a bit, we always need to keep in mind why the schemas are not the same, what is their difference, etc.

Basically we have a check earlier in the planner that asserts equality for the schema from batch and from the planner.

https://github.com/search?q=repo%3Aapache%2Farrow-datafusion%20mismatch%20between&type=code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @comphead, It seems that we really don't need physical_input_schema. Removed it, thanks for the suggestion.

@mustafasrepo mustafasrepo merged commit b5db718 into apache:main Jan 24, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants