-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement JSON type in FE #3084
Conversation
587fa00
to
d19ae67
Compare
fc57327
to
0a4fd6f
Compare
fe/fe-core/src/main/java/com/starrocks/catalog/PrimitiveType.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/catalog/PrimitiveType.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/catalog/ScalarFunction.java
Outdated
Show resolved
Hide resolved
@@ -4288,6 +4293,11 @@ array_slice ::= | |||
{: RESULT = new ArraySliceExpr(e, new IntLiteral(0), new IntLiteral(-1)); :} | |||
; | |||
|
|||
arrow_expr ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this arrow_expr neceesary for JOSN?
I'm a little worried if this definition will be conflict with lambda expression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arrow expression looks like '->', currently used a syntax sugar for JSON.
Current implementation of arrow expression is just translate into json_query($value, $path)
, which would conflict with some other usage like lambda expression.
However, I think it's quite easy to avoid conflicts, just look up the context of this expression, and translate it according to the context.
Anyway, some existing jsonpath sugar, like col->'field'
, col.k1.k2
, col[k1][k2]
, are always has ambiguity with other SQL syntax, there's no simple approach to create an unique syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm worried is that these two expr will cause shift/reduce conflict when parsing phase if we support lambda later.
One way is to create a super expr compatible with both ArorwExpr and Lambda.
Is it possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possible way:
arrow_expr is defined as : left_expr '->' right_expr
.
Resolve rule:
- If
left_expr
could be resolved ajson
type, including column_ref or function result, it's a json access expression. And theright_expr
must be a literal string expression. - Otherwise,
left_expr
could not be resolved, the whole expression is recognized as lambda expression
Which means, in parsing phase they could not be differentiated, only analyzer could tell the truth.
21debc1
to
1769edd
Compare
ebfaed6
to
0be97bf
Compare
* Update STREAM LOAD.md * Update BROKER LOAD.md * modified file_path descriptions in BROKERLOAD.md
What type of PR is this:
Modification
json
for typejson
type in Type.javajson
type in thrift->
syntax for json_query functionNot included