You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Alessandro Solimando (Jira)" <ji...@apache.org> on 2020/10/28 21:59:00 UTC

[jira] [Comment Edited] (CALCITE-4354) add support for ROW/STRUCT data types to ITEM operator

    [ https://issues.apache.org/jira/browse/CALCITE-4354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17222410#comment-17222410 ] 

Alessandro Solimando edited comment on CALCITE-4354 at 10/28/20, 9:58 PM:
--------------------------------------------------------------------------

Thank you all for your input, I have update the ticket and the PR following your comments, can you please have a look if I got it right?

Regarding the index, it's already 1-based to be consistent with what the array type does (as [~danny0405]  was also pointing out).


was (Author: asolimando):
Thank you all for your input, I will update the ticket and the PR to address your comments.

Regarding the index, it's already 1-based to be consistent with what the array type does (as [~danny0405]  was also pointing out).

> add support for ROW/STRUCT data types to ITEM operator
> ------------------------------------------------------
>
>                 Key: CALCITE-4354
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4354
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.27.0
>            Reporter: Alessandro Solimando
>            Assignee: Alessandro Solimando
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> 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:
> {code:java}
> select au."birthPlace"."city" as city from "bookstore"."authors" au;{code}
>   
> The extended implementation will also support the following equivalent query:
> {code:java}
> select au."birthPlace"['city'] as city from "bookstore"."authors" au;
> {code}
>  
> And since we have that "birthPlace(coords, city, country)", we can also access "city" with its index 2: 
> {code:java}
> select au."birthPlace"[2] as city from "bookstore"."authors" au;{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)