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

Update SqlTableAliasSimplifier to handle CTEs #1516

Merged
merged 4 commits into from
Nov 13, 2024
Merged

Update SqlTableAliasSimplifier to handle CTEs #1516

merged 4 commits into from
Nov 13, 2024

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Nov 10, 2024

Similar to the updates for the other optimizers in #1503 and #1504, this PR implements the CTE case for the SqlTableAliasSimplifier

@plypaul plypaul marked this pull request as ready for review November 12, 2024 01:23
mf_test_configuration: MetricFlowTestConfiguration,
sql_plan_renderer: DefaultSqlQueryPlanRenderer,
) -> None:
"""Tests that table aliases are removed when not needed in CTEs."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also have a test to demonstrate that table aliases are not removed if they are needed in CTEs?
I'm assuming that would only happen if there was a join within the CTE statement. Not sure if that case will ever occur with the current CTE implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't hurt - added a test case.

@plypaul plypaul merged commit 58d6e6e into main Nov 13, 2024
15 checks passed
@plypaul plypaul deleted the p--cte--10 branch November 13, 2024 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants