Repository navigation
Add Support for Field Star in Nested Function. - #278
Conversation
Codecov Report
@@ Coverage Diff @@
## integ-nested-all-fields #278 +/- ##
=============================================================
+ Coverage 97.29% 97.30% +0.01%
- Complexity 4408 4425 +17
=============================================================
Files 388 388
Lines 10944 10996 +52
Branches 774 780 +6
=============================================================
+ Hits 10648 10700 +52
Misses 289 289
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
8c65c16 to
dba24ea
Compare
| TypeEnvironment environment = context.peek(); | ||
| Map<String, ExprType> lookupAllTupleFields = | ||
| environment.lookupAllTupleFields(Namespace.FIELD_NAME); | ||
| environment.resolve(new Symbol(Namespace.FIELD_NAME, node.getPath())); |
There was a problem hiding this comment.
does this work with aliases? I think we need to consider resolving the nested symbol with alias instead of path if an alias if given.
There was a problem hiding this comment.
Consider re-using this for when we want to deal with PartiQL tables. We will want to have multiple symbol tables for joins, nested, etc. Being able to generate a 'nested' symbol table from an existing table would be beneficial for PartiQL syntax.
There was a problem hiding this comment.
allTupleFields like allFields is not supported with aliases. It wouldn't make sense as the column identifiers are expanded. I think resolving with the alias would always throw a semantic exception as the alias isn't stored in the FIELD_NAME portion to the symbolTable.
There was a problem hiding this comment.
Don't think I fully understand what you mean about generating symbol tables for partiql. I see for joins but what is a nested symbol table?
|
These fails: SELECT upper(nested(message.*)) from nested-type;
SELECT nested(message.*) + 42 from nested-type;
|
SELECT nested(message.*) from nested-type limit 4;returns 5 rows Probably, you shouldn't push down limit when UPDIt is not a bug introduced by this feature, it present on |
|
I added safeguards for these cases. Now they return UnsupportedOperationException. |
Yury-Fridlyand
left a comment
There was a problem hiding this comment.
Can you add ITs with incorrect usages of nested-with-star? Maybe a doctest too.
Signed-off-by: forestmvey <[email protected]>
…n wrong clause. Signed-off-by: forestmvey <[email protected]>
7895f78 to
35bab09
Compare
Description
Add support for using the
*at end of field parameter in the nested function. All nested fields under supplied path will be expanded as column identifiers. Grammar has been added to only support theAllTupleFieldsusage with the nested function since this change will effect field usage in all queries and needs further planning with V2 implementation.Example Queries
Issues Resolved
Portion of Issue: 1111
Changes From Legacy
Edge Cases
Queries that produce repeating column identifiers like:
Or
Will result in error:
{ "error": { "reason": "Invalid SQL query", "details": "Multiple entries with same key: nested(message.info)=\"a\" and nested(message.info)=\"a\"", "type": "IllegalArgumentException" }, "status": 400 }Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.