fix(flink): #415 fix supporting json function's different type #416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复问题
#415
描述
发现的问题是在flinkSQL里使用
JSON_VALUE
方法会飘红,在g4文件中之前归类过方法的使用类型,但发现JSON_VALUE
作为保留字关键字的方法名,并没有添加到保留字关键字方法名的枚举里去。改动点:
1、顺着上面思路去检查同为保留字关键字在lexer文件中声明过的keyword 是否 都在parser文件中的保留字关键字方法名rule里枚举到了,必须保持两边是一致,顺着这条思路检查到了以下几个JSON方法名:
2、但在JSON Functions里面,还有个特殊使用,就是
xx IS JSON [ { VALUE | SCALAR | ARRAY | OBJECT } ]
,这种使用是之前没有声明过的,所以补全了这种用法3、补全了以上语法变动的单测SQL
参考