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

fix external table virtual columns #284

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions simple_ddl_parser/dialects/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,27 @@ def p_expression_pattern(self, p: List) -> None:
p_list = remove_par(list(p))
p[0]["pattern"] = p_list[-1]

def p_recursive_pid(self, p: List) -> None:
"""recursive_pid : pid
| multi_id
| id LP RP
| id LP pid RP
| id LP pid RP pid
| id COMMA pid
| id LP id LP recursive_pid RP COMMA pid RP
| multi_id LP pid RP
| id LP multi_id RP
| id LP id AS recursive_pid RP
| id LP id LP recursive_pid RP AS recursive_pid RP
"""
p_list = list(p)
items = [item if isinstance(item, str) else ",".join(item) for item in p_list[1:]]
p[0] = "".join(items)

def p_as_virtual(self, p: List):
"""as_virtual : AS LP id LP id LP pid RP COMMA pid RP RP
| AS LP id LP pid RP RP
| AS LP multi_id RP
| AS LP ID STRING_BASE RP ID RP
| AS LP f_call RP id RP
| as_virtual ID
| AS LP id LP pid RP ID RP"""
"""as_virtual : AS LP id RP
| AS LP recursive_pid RP
| AS LP id LP id LP multi_id COMMA pid RP AS recursive_pid RP RP"""
_as = ""
# Simple function else Nested function call
if len(p) == 5:
Expand Down
Loading
Loading