Skip to content

Conversation

@berkaysynnada
Copy link
Contributor

Which issue does this PR close?

Closes #12054.

Rationale for this change

Our downstream tests started failing after #11681. In calc_func_dependencies_for_project(), the projection length is no longer taken from the expression length. Instead, wildcard expressions are now counted based on the number of fields in the wildcard schema. The problem occurs when the wildcard expression has a table reference, but the wildcard schema is built on multiple tables.

What changes are included in this PR?

This PR filters the wildcard schema according to the table reference of the wildcard expression.

Are these changes tested?

Yes, a minimal example of our failing test has been added to joins.slt.

Are there any user-facing changes?

Copy link
Contributor

@ozankabak ozankabak left a comment

Choose a reason for hiding this comment

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

Minor style suggestion, otherwise LGTM

Co-authored-by: Mehmet Ozan Kabak <[email protected]>
@github-actions github-actions bot added logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) labels Aug 19, 2024
Copy link
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

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

Thank @berkaysynnada for fixing this. LGTM. Just one minor comment.
I'm sorry for missing this case 😭

);

statement ok
CREATE TABLE exchange_rates (
Copy link
Contributor

Choose a reason for hiding this comment

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

How about dorp sales_global and exchange_rates after the test?

@ozankabak
Copy link
Contributor

Thank you @goldmedal for reviewing

@ozankabak ozankabak merged commit c60b798 into apache:main Aug 19, 2024
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.

Bug in Functional Dependency Calculation for Projection

3 participants