Skip to content

Commit 8aa5369

Browse files
author
zhaoge
committed
feat: optimize collecting entity when match empty column in entityCollecting context
1 parent cd3626c commit 8aa5369

21 files changed

Lines changed: 8846 additions & 7344 deletions

src/grammar/flink/FlinkSqlParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ columnProjectItem
509509
| selectLiteralColumnName (columnAlias | KW_AS? expression)?
510510
| tableAllColumns columnAlias?
511511
| selectExpressionColumnName (columnAlias | KW_AS? columnName)?
512+
| {this.shouldMatchEmpty()}? emptyColumn
512513
;
513514

514515
selectWindowItemColumnName

src/grammar/hive/HiveSqlParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,7 @@ selectItem
15361536
| KW_AS LPAREN alias=id_ (COMMA alias=id_)* RPAREN
15371537
)?
15381538
)
1539+
| {this.shouldMatchEmpty()}? emptyColumn
15391540
;
15401541

15411542
selectLiteralColumnName

src/grammar/impala/ImpalaSqlParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ selectItem
823823
: selectLiteralColumnName columnAlias?
824824
| selectExpressionColumnName columnAlias?
825825
| tableAllColumns
826+
| {this.shouldMatchEmpty()}? emptyColumn
826827
;
827828

828829
columnAlias

src/grammar/postgresql/PostgreSqlParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2634,6 +2634,7 @@ targetList
26342634
targetEl
26352635
: tableAllColumns # target_star
26362636
| (selectLiteralColumnName | selectExpressionColumnName) (KW_AS? alias=identifier |) # target_label
2637+
| {this.shouldMatchEmpty()}? emptyColumn # target_empty
26372638
;
26382639

26392640
tableAllColumns
@@ -2733,7 +2734,6 @@ columnName
27332734

27342735
columnNamePath
27352736
: colId optIndirection
2736-
| {this.shouldMatchEmpty()}? (colId DOT emptyColumn | emptyColumn)
27372737
;
27382738

27392739
columnNameCreate

src/grammar/spark/SparkSqlParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ namedExpression
850850
: (tableAllColumns | selectLiteralColumnName | selectExpressionColumnName) (
851851
KW_AS? (alias=errorCapturingIdentifier | identifierList)
852852
)?
853+
| {this.shouldMatchEmpty()}? emptyColumn
853854
;
854855

855856
namedExpressionSeq

src/lib/flink/FlinkSqlParser.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)