Skip to content

Commit c291daf

Browse files
author
zhaoge
committed
feat(postgresql): collect hive sql's attribute(alias,colType)
1 parent aaa21da commit c291daf

File tree

6 files changed

+1904
-1747
lines changed

6 files changed

+1904
-1747
lines changed

src/grammar/postgresql/PostgreSqlParser.g4

+4-4
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ typedtableelement
620620
;
621621

622622
column_def
623-
: column_name_create typename create_generic_options? (
623+
: column_name_create colType=typename create_generic_options? (
624624
KW_STORAGE (KW_PLAIN | KW_EXTERNAL | KW_EXTENDED | KW_MAIN | KW_DEFAULT | colid)
625625
)? (KW_COMPRESSION colid)? (opt_collate_clause)? (KW_WITH KW_OPTIONS)? colconstraint*
626626
;
@@ -2163,12 +2163,12 @@ table_ref
21632163
;
21642164

21652165
alias_clause
2166-
: KW_AS? colid (OPEN_PAREN name_list CLOSE_PAREN)?
2166+
: KW_AS? alias=colid (OPEN_PAREN name_list CLOSE_PAREN)?
21672167
;
21682168

21692169
func_alias_clause
21702170
: alias_clause
2171-
| (KW_AS colid? | colid) OPEN_PAREN tablefuncelementlist CLOSE_PAREN
2171+
| (KW_AS alias=colid? | alias=colid) OPEN_PAREN tablefuncelementlist CLOSE_PAREN
21722172
;
21732173

21742174
join_type
@@ -2600,7 +2600,7 @@ func_arg_list
26002600

26012601
func_arg_expr
26022602
: expression
2603-
| type_function_name (COLON_EQUALS | EQUALS_GREATER) expression
2603+
| type_function_name ((COLON_EQUALS | EQUALS_GREATER) expression)?
26042604
;
26052605

26062606
array_expr

src/lib/postgresql/PostgreSqlParser.interp

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)