You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Rong Rong (JIRA)" <ji...@apache.org> on 2017/07/12 21:03:00 UTC

[jira] [Commented] (FLINK-7003) "select * from" in Flink SQL should not flatten all fields in the table by default

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

Rong Rong commented on FLINK-7003:
----------------------------------

Probably need to write extensive tests to verify the resulting unflatten table in all tableAPIs?

> "select * from" in Flink SQL should not flatten all fields in the table by default
> ----------------------------------------------------------------------------------
>
>                 Key: FLINK-7003
>                 URL: https://issues.apache.org/jira/browse/FLINK-7003
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: Shuyi Chen
>
> Currently, CompositeRelDataType is extended from RelRecordType(StructKind.PEEK_FIELDS, ...).  In Calcite, StructKind.PEEK_FIELDS would allow us to peek fields for nested types. However, when we use "select * from", calcite will flatten all nested fields that is marked as StructKind.PEEK_FIELDS in the table. 
> For example, 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} should return (K0, C1, F0, F1) instead of (K0, C1, F0.C0, F0.C1, F1.C0, F1.C1), which is the current behavior.
> After upgrading to Calcite 1.14, this issue should change the type of {{CompositeRelDataType}} to {{StructKind. PEEK_FIELDS_NO_EXPAND}}.



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