Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Oct 31, 2025

Which issue does this PR close?

Rationale for this change

It is a bug we are seeing in our production related to a schema mismatch

What changes are included in this PR?

  1. New slt test for the issue
  2. Properly compute the output field from window functions

Are these changes tested?

Yes

Are there any user-facing changes?

@alamb alamb force-pushed the alamb/query_metadata_error branch from 1c7b1ca to 113eaa2 Compare January 6, 2026 19:01
@alamb alamb changed the title WIP: Fix internal error "Physical input schema should be the same as the one converted from logical input schema." Fix internal error "Physical input schema should be the same as the one converted from logical input schema." Jan 6, 2026
@github-actions github-actions bot added the logical-expr Logical plan and expressions label Jan 6, 2026
schema: &dyn ExprSchema,
window_function: &WindowFunction,
) -> Result<(DataType, bool)> {
) -> Result<FieldRef> {
Copy link
Contributor Author

@alamb alamb Jan 6, 2026

Choose a reason for hiding this comment

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

the point is to return the entire field, rather than just the DataType and nullability so that any metadata attached to the field is also properly returned

I think the prior construction is from a time before Fields

@alamb alamb marked this pull request as ready for review January 6, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal error: Physical input schema should be the same as the one converted from logical input schema.

1 participant