You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vladimir Sitnikov (JIRA)" <ji...@apache.org> on 2017/09/08 10:12:00 UTC

[jira] [Commented] (CALCITE-1856) Add option StructKind.PEEK_FIELDS_NO_EXPAND, similar to PEEK_FIELDS but is not expanded in "SELECT *"

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

Vladimir Sitnikov commented on CALCITE-1856:
--------------------------------------------

{{select *}} projects RecordType:peek_no_flattening fields as well, however I do not need them. I just need some "available yet invisible to {{select *}} fields". Is it possible?


> Add option StructKind.PEEK_FIELDS_NO_EXPAND, similar to PEEK_FIELDS but is not expanded in "SELECT *"
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1856
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1856
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Shuyi Chen
>            Assignee: Julian Hyde
>             Fix For: 1.14.0
>
>
> In Calcite, StructKind.PEEK_FIELDS allow see its fields without qualifying them with the name of this field. For example, if address is labeled PEEK_FIELDS, one could write zipcode as shorthand for address.zipcode, i.e., the following SQL is allowed:
> {code:java}
> Select zipcode from T
> {code}
> StructKind.FULLY_QUALIFIED is the normal SQL behavior, where each field must be referenced explicitly, i.e. the above SQL will fail.
> But currently in calcite, a side effect of using PEEK_FIELDS is that "select *" will recursively flatten the PEEK_FIELDS RecordType. We want to add an option call PEEK_FIELDS_NO_FLATTENING to disable the behavior.
> With the new option, if the table structure *T* is as follows:
> {code:java}
> VARCHAR K0,
> VARCHAR C1,
> RecordType:peek_no_flattening(INTEGER C0, INTEGER C1) F0,
> RecordType:peek_no_flattening(INTEGER C0, INTEGER C2) F1
> {code}
> The following query
> {code:java}
> Select * from T
> {code} will return (K0, C1, F0, F1) instead of (K0, C1, F0.C0, F0.C1, F1.C0, F1.C1)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)