fix(expressions): wrap string alias in TableAlias in to_table()#7352
Open
Tigeneric wants to merge 1 commit intotobymao:mainfrom
Open
fix(expressions): wrap string alias in TableAlias in to_table()#7352Tigeneric wants to merge 1 commit intotobymao:mainfrom
Tigeneric wants to merge 1 commit intotobymao:mainfrom
Conversation
to_table() passes alias as raw string via table.set(k, v), but qualify_columns expects TableAlias(this=Identifier(...)). This causes qualify_columns to fail on AST-built queries with table aliases. Wraps string alias in TableAlias(this=to_identifier(v)) before table.set() — same pattern already used in table_().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
to_table()passes alias as a raw string viatable.set(k, v), butqualify_columnsexpectsTableAlias(this=Identifier(...)). This causesqualify_columnsto fail on AST-built queries with table aliases.Repro:
Fix
Wraps string alias in
TableAlias(this=to_identifier(v))beforetable.set()— same pattern already used intable_()(line 513).2-line change, no behavior change for non-string aliases.