-
Notifications
You must be signed in to change notification settings - Fork 313
Closed
Labels
BugSomething isn't workingSomething isn't working
Description
Expression which include a table identifier resolved through a macro like:
FULL OUTER JOIN @SQL('@target') AS tgt
resolves into the following AST:
(JOIN this:
(TABLE this:
(COLUMN this:
(IDENTIFIER this: orders, quoted: False), table:
(IDENTIFIER this: sushi, quoted: False)), alias:
(TABLEALIAS this:
(IDENTIFIER this: tgt, quoted: False))), side: FULL, kind: OUTER, on:
...
The TABLE node contains another COLUMN node instead of just IDENTIFIERS. For comparison here's the same AST, but with the value inserted directly instead of through a macro:
(JOIN this:
(TABLE this:
(IDENTIFIER this: orders, quoted: False), db:
(IDENTIFIER this: sushi, quoted: False), alias:
(TABLEALIAS this:
(IDENTIFIER this: tgt, quoted: False))), side: FULL, kind: OUTER, on:
...
Because of the invalid AST other sql-related functionality like eg. exp.replace_tables doesn't work correctly.
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working
Type
Projects
Status
Done