-
Notifications
You must be signed in to change notification settings - Fork 146
SNOW-2019483: fix select SQL in dynamic table #3259
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
Changes from 17 commits
d15ea60
b5b68e2
106385d
9a6939b
da7adca
c321884
112d7ba
6eeb25d
5576548
5c6f53f
35eda2e
4d2e82d
5b758af
ff3303e
6d829ff
999e5d4
6263efb
7ab12a3
d2a7425
94a4d8f
916e9bb
4a31b0e
c1f2865
187bb92
a65e94a
009637e
0b63111
b20bd1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,7 @@ | |||||
| import re | ||||||
| import sys | ||||||
| import uuid | ||||||
| from collections import defaultdict | ||||||
| from collections import defaultdict, deque | ||||||
| from enum import Enum | ||||||
| from functools import cached_property | ||||||
| from typing import ( | ||||||
|
|
@@ -30,6 +30,7 @@ | |||||
| from snowflake.snowpark._internal.analyzer.table_function import ( | ||||||
| GeneratorTableFunction, | ||||||
| TableFunctionRelation, | ||||||
| TableFunctionJoin, | ||||||
| ) | ||||||
|
|
||||||
| if TYPE_CHECKING: | ||||||
|
|
@@ -1324,6 +1325,58 @@ def create_or_replace_view( | |||||
| source_plan, | ||||||
| ) | ||||||
|
|
||||||
| def find_table_function_in_sql_tree(self, plan: SnowflakePlan): | ||||||
|
||||||
| """This function is meant to find any table function call from a create dynamic table plan and | ||||||
|
||||||
| replace '*' with explicit identifier in the select of table function. | ||||||
|
||||||
| replace '*' with explicit identifier in the select of table function. | |
| replace '*' with explicit column identifiers in the select of table function. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the comment: tale function should be table function
| # this is meant to decide whether the plan is select from a tale function | |
| # this is meant to decide whether the plan is select from a table function |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
sfc-gh-yuwang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
sfc-gh-yuwang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
sfc-gh-yuwang marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is is possible for a Selebtable to have a snowflake_plan where source_plan is None. Can we make sure that is not the case here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the case shall not happen here, @sfc-gh-jdu can you help me confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's possible. But to be safe, can we exit the recursion if it's None?
Uh oh!
There was an error while loading. Please reload this page.