Skip to content

Commit 320fe22

Browse files
committed
fix: #464 JSON_VALUE RETURNING
1 parent d079995 commit 320fe22

File tree

11 files changed

+6536
-6323
lines changed

11 files changed

+6536
-6323
lines changed

src/grammar/flink/FlinkSqlLexer.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ KW_PERCENTILE_DISC : 'PERCENTILE_DISC';
306306
KW_PERCENT_RANK : 'PERCENT_RANK';
307307
KW_PERIOD : 'PERIOD';
308308
KW_PERMUTE : 'PERMUTE';
309+
KW_RETURNING : 'RETURNING';
309310
KW_PIVOT : 'PIVOT';
310311
KW_PORTION : 'PORTION';
311312
KW_POSITION : 'POSITION';

src/grammar/flink/FlinkSqlParser.g4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ primaryExpression
794794
| dereferenceDefinition # dereference
795795
| LR_BRACKET expression RR_BRACKET # parenthesizedExpression
796796
| KW_EXTRACT LR_BRACKET field=identifier KW_FROM source=valueExpression RR_BRACKET # extract
797+
| jsonValueExpression # jsonValue
797798
// | (SUBSTR | SUBSTRING) LR_BRACKET str=valueExpression (KW_FROM | COMMA) pos=valueExpression
798799
// ((KW_FOR | COMMA) len=valueExpression)? RR_BRACKET #substring
799800
// | TRIM LR_BRACKET trimOption=(BOTH | LEADING | TRAILING)? (trimStr=valueExpression)?
@@ -802,6 +803,10 @@ primaryExpression
802803
// KW_FROM position=valueExpression (KW_FOR length=valueExpression)? RR_BRACKET #overlay
803804
;
804805

806+
jsonValueExpression
807+
: KW_JSON_VALUE LR_BRACKET expression COMMA stringLiteral (KW_RETURNING columnType)? RR_BRACKET
808+
;
809+
805810
functionNameCreate
806811
: uid
807812
;

src/lib/flink/FlinkSqlLexer.interp

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

0 commit comments

Comments
 (0)