Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.27.0
Description
The current implementation of the "ITEM" operator cannot be apply to row/struct type.
The idea is to extend "ITEM" to support a signature "<ROW>[<CHARACTER|INTEGER>]", allowing to access elements by their position (1-based index), or their name (if available).
The current implementation supports an SQL query as follows:
select au."birthPlace"."city" as city from "bookstore"."authors" au;
The extended implementation will also support the following equivalent query:
select au."birthPlace"['city'] as city from "bookstore"."authors" au;
And since we have that "birthPlace(coords, city, country)", we can also access "city" with its index 2:
select au."birthPlace"[2] as city from "bookstore"."authors" au;
Attachments
Issue Links
- is related to
-
CALCITE-4436 Use the fields order from the struct type for 'ITEM(STRUCT, INDEX)' access
- Closed
- relates to
-
CALCITE-4293 cassandra adapter returns null when selecting non-null tuple elements
- Closed
-
CALCITE-5701 Add NAMED_STRUCT function (enabled in Spark library)
- Open
- links to