@@ -1122,7 +1122,7 @@ joinPart
11221122 ;
11231123
11241124joinSpec
1125- : (KW_ON expression)
1125+ : (KW_ON ( expression | columnNamePathAllowEmpty) )
11261126 | KW_USING ' (' columnNames ' )'
11271127 ;
11281128
@@ -1249,7 +1249,7 @@ selectLinesInto
12491249 ;
12501250
12511251fromClause
1252- : (KW_FROM tableSources)? (KW_WHERE whereExpr=expression)?
1252+ : (KW_FROM tableSources)? (KW_WHERE ( whereExpr=expression | columnNamePathAllowEmpty) )?
12531253 ;
12541254
12551255groupByClause
@@ -2419,10 +2419,24 @@ columnNames
24192419 : columnName (' ,' columnName)*
24202420 ;
24212421
2422+ emptyColumn
2423+ :
2424+ ;
2425+
24222426columnName
2427+ : uid (dottedIdAllowEmpty dottedIdAllowEmpty?)?
2428+ | .? dottedId dottedId?
2429+ | {this.shouldMatchEmpty()} ? emptyColumn
2430+ ;
2431+
2432+ columnNamePath
24232433 : uid (dottedId dottedId?)?
24242434 | .? dottedId dottedId?
2425- | {this.shouldMatchEmpty()} ?
2435+ ;
2436+
2437+ columnNamePathAllowEmpty
2438+ : {this.shouldMatchEmpty()} ? emptyColumn
2439+ | uid (dottedIdAllowEmpty dottedIdAllowEmpty?)?
24262440 ;
24272441
24282442tableSpaceNameCreate
@@ -2560,6 +2574,12 @@ dottedId
25602574 | ' .' uid
25612575 ;
25622576
2577+ dottedIdAllowEmpty
2578+ : DOT ID
2579+ | ' .' uid
2580+ | {this.shouldMatchEmpty()} ? DOT emptyColumn
2581+ ;
2582+
25632583decimalLiteral
25642584 : DECIMAL_LITERAL
25652585 | ZERO_DECIMAL
@@ -2998,7 +3018,7 @@ expressionAtom
29983018 | left=expressionAtom jsonOperator right=expressionAtom # jsonExpressionAtom
29993019 | left=expressionAtom bitOperator right=expressionAtom # bitExpressionAtom
30003020 | left=expressionAtom mathOperator right=expressionAtom # mathExpressionAtom
3001- | columnName # columnNameExpressionAtom
3021+ | columnNamePath # columnNameExpressionAtom
30023022 ;
30033023
30043024unaryOperator
0 commit comments