@@ -96,20 +96,20 @@ createKuduTableAsSelect
96
96
: KW_CREATE KW_EXTERNAL ? KW_TABLE ifNotExists? tableNameCreate (
97
97
LPAREN kuduTableElement (COMMA kuduTableElement)* (COMMA KW_PRIMARY KW_KEY columnAliases)? RPAREN
98
98
)? (KW_PRIMARY KW_KEY columnAliases?)? (KW_PARTITION KW_BY kuduPartitionClause)? (
99
- KW_COMMENT stringLiteral
99
+ commentClause
100
100
)? KW_STORED KW_AS KW_KUDU (KW_TBLPROPERTIES tblProp=properties)? (KW_AS queryStatement)?
101
101
;
102
102
103
103
createView
104
- : KW_CREATE KW_VIEW ifNotExists? viewNameCreate viewColumns? ( KW_COMMENT stringLiteral) ? (
104
+ : KW_CREATE KW_VIEW ifNotExists? viewNameCreate viewColumns? commentClause ? (
105
105
KW_TBLPROPERTIES tblProp=properties
106
106
)? KW_AS queryStatement
107
107
;
108
108
109
109
createSchema
110
- : KW_CREATE (KW_SCHEMA | KW_DATABASE ) ifNotExists? databaseNameCreate (
111
- KW_COMMENT comment =stringLiteral
112
- )? ( KW_LOCATION location=stringLiteral)?
110
+ : KW_CREATE (KW_SCHEMA | KW_DATABASE ) ifNotExists? databaseNameCreate (commentClause)? (
111
+ KW_LOCATION location =stringLiteral
112
+ )?
113
113
;
114
114
115
115
createRole
@@ -119,14 +119,14 @@ createRole
119
119
createAggregateFunction
120
120
: KW_CREATE KW_AGGREGATE ? KW_FUNCTION ifNotExists? functionNameCreate (
121
121
LPAREN (type (COMMA type)*)? RPAREN
122
- )? KW_RETURNS type (KW_INTERMEDIATE type)? KW_LOCATION STRING (KW_INIT_FN EQ STRING )? KW_UPDATE_FN EQ STRING KW_MERGE_FN EQ STRING (
122
+ )? KW_RETURNS returnType= type (KW_INTERMEDIATE type)? KW_LOCATION STRING (KW_INIT_FN EQ STRING )? KW_UPDATE_FN EQ STRING KW_MERGE_FN EQ STRING (
123
123
KW_PREPARE_FN EQ STRING
124
124
)? (KW_CLOSEFN EQ STRING )? (KW_SERIALIZE_FN EQ STRING )? (KW_FINALIZE_FN EQ STRING )?
125
125
;
126
126
127
127
createFunction
128
128
: KW_CREATE KW_FUNCTION ifNotExists? functionNameCreate (LPAREN (type (COMMA type)*)? RPAREN )? (
129
- KW_RETURNS type
129
+ KW_RETURNS returnType= type
130
130
)? KW_LOCATION STRING KW_SYMBOL EQ symbol=stringLiteral
131
131
;
132
132
@@ -569,11 +569,9 @@ tableOrViewPath
569
569
;
570
570
571
571
createCommonItem
572
- : (KW_SORT KW_BY columnAliases)? (KW_COMMENT comment=stringLiteral)? (
573
- KW_ROW KW_FORMAT rowFormat
574
- )? (KW_WITH KW_SERDEPROPERTIES serdProp=properties)? (KW_STORED KW_AS fileFormat)? (
575
- KW_LOCATION location=stringLiteral
576
- )? (
572
+ : (KW_SORT KW_BY columnAliases)? commentClause? (KW_ROW KW_FORMAT rowFormat)? (
573
+ KW_WITH KW_SERDEPROPERTIES serdProp=properties
574
+ )? (KW_STORED KW_AS fileFormat)? (KW_LOCATION location=stringLiteral)? (
577
575
KW_CACHED KW_IN cacheName=qualifiedName (KW_WITH KW_REPLICATION EQ INTEGER_VALUE )?
578
576
| KW_UNCACHED
579
577
)? (KW_TBLPROPERTIES tblProp=properties)?
@@ -588,9 +586,11 @@ assignmentItem
588
586
;
589
587
590
588
viewColumns
591
- : LPAREN columnNamePathCreate (KW_COMMENT stringLiteral)? (
592
- COMMA columnNamePathCreate (KW_COMMENT stringLiteral)?
593
- )* RPAREN
589
+ : LPAREN viewColumnItem? (COMMA viewColumnItem?)* RPAREN
590
+ ;
591
+
592
+ viewColumnItem
593
+ : columnNamePathCreate commentClause?
594
594
;
595
595
596
596
queryStatement
@@ -621,19 +621,23 @@ columnSpec
621
621
;
622
622
623
623
columnDefinition
624
- : columnNamePathCreate type ( KW_COMMENT stringLiteral) ?
624
+ : columnNamePathCreate colType= type commentClause ?
625
625
;
626
626
627
627
kuduTableElement
628
628
: kuduColumnDefinition
629
629
;
630
630
631
631
kuduColumnDefinition
632
- : columnNamePathCreate type (kuduAttributes kuduAttributes*?)? ( KW_COMMENT stringLiteral) ? (
632
+ : columnNamePathCreate colType= type (kuduAttributes kuduAttributes*?)? commentClause ? (
633
633
KW_PRIMARY KW_KEY
634
634
)?
635
635
;
636
636
637
+ commentClause
638
+ : KW_COMMENT comment=stringLiteral
639
+ ;
640
+
637
641
columnSpecWithKudu
638
642
: columnSpec (kuduAttributes kuduAttributes*?)?
639
643
;
@@ -838,7 +842,7 @@ sampleType
838
842
;
839
843
840
844
aliasedRelation
841
- : relationPrimary (KW_AS ? identifier columnAliases?)?
845
+ : relationPrimary (KW_AS ? alias= identifier columnAliases?)?
842
846
;
843
847
844
848
columnAliases
0 commit comments