Support json value constructors#12049
Merged
kasiafi merged 4 commits intotrinodb:masterfrom Jun 6, 2022
Merged
Conversation
5f934bc to
d2d1727
Compare
losipiuk
reviewed
Apr 27, 2022
core/trino-main/src/test/java/io/trino/sql/query/TestListagg.java
Outdated
Show resolved
Hide resolved
Member
There was a problem hiding this comment.
can you use different values to test a more generic case?
You can then assert that resulting json has either of two values.
Member
Author
There was a problem hiding this comment.
I added a new assert method for the "ambiguous" case. It checks that the result is in a given set.
core/trino-parser/src/main/java/io/trino/sql/tree/JsonObject.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/tree/JsonArray.java
Outdated
Show resolved
Hide resolved
core/trino-parser/src/main/java/io/trino/sql/parser/AstBuilder.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/scalar/json/JsonArrayFunction.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
ac0c62d to
3eb1fb1
Compare
4b4793e to
afc4410
Compare
Member
Author
|
@losipiuk I addressed comments. |
Preparatory commit before `VALUE` is made a non-reserved keyword For the purpose of supporting the JSON_OBJECT function. This commit changes a colmn name from `value` to `v` in a test which verifies error messages on parse exceptions. If a query contains an identifier being a non-reserved token, and later in te query text there's parse error, the error message points to the correct location of the error, but it incorrectly returns the non-reserved keyword as the erroneous token.
Support the json constructor functions as described in SQL standard. This change includes full grammar and AST for json object constructor, and full grammar and AST for json array constructor by enumeration. Json array constructor by query is not yet supported. It should be added after the JSON_ARRAYAGG function is supported.
16cf294 to
f285c00
Compare
losipiuk
approved these changes
Jun 6, 2022
f285c00 to
2340165
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Support
json_object()andjson_array()functions, as specified by the SQL standard.Documentation #12677