Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-7051 Bump up Calcite version to 1.14
  3. FLINK-7003

"select * from" in Flink SQL should not flatten all fields in the table by default

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0, 1.5.0
    • Table SQL / API
    • None

    Description

      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:

      VARCHAR K0,
      VARCHAR C1,
      RecordType:peek_no_flattening(INTEGER C0, INTEGER C1) F0,
      RecordType:peek_no_flattening(INTEGER C0, INTEGER C2) F1
      
      

      The following query

      Select * from T
      

      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.

      Attachments

        Issue Links

          Activity

            People

              suez1224 Shuyi Chen
              suez1224 Shuyi Chen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: