Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2776

Wrong value when accessing struct types with one attribute

    XMLWordPrintableJSON

    Details

      Description

      The accessors for struct types with one attribute are not created correctly leading to wrong values when the internal representation for structured types is an Object[].

      For example consider the following query:

      select * from (values
          (1, ROW(1)),
          (2, ROW(2))) as v(id,struct);
      

      Executing this query on calcite returns:

       +----+--------------------------------+
       | ID | STRUCT                         |
       +----+--------------------------------+
       |  1 | {[Ljava.lang.Object;@4ff4357f} |
       |  2 | {[Ljava.lang.Object;@49cb9cb5} |
       +----+--------------------------------+
      

      instead of:

      +----+--------+
      | ID | STRUCT |
      +----+--------+
      |  1 | {1}    |
      |  2 | {2}    |
      +----+--------+
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zabetak Stamatis Zampetakis
                Reporter:
                zabetak Stamatis Zampetakis
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h