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

Improve handling of ARRAY, MULTISET, STRUCT types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Improve end-to-end handling of STRUCT, MAP, ARRAY and MULTISET types.

      Add annotations org.apache.calcite.adapter.java.Array and org.apache.calcite.adapter.java.Map to declare that a member of a class (i.e. a column) is of ARRAY or MAP type, and what the element/key/value types are.

      Add metadata so that Avatica JDBC knows that when you have gone into an ARRAY column you are looking at a record type of say (INTEGER, ARRAY DOUBLE). Currently the metadata only goes one level down and after that you are looking at objects.

      When an array or multiset is read, we need to know how it is internally represented. Currently it could be of type CUSTOM (e.g. a bean class such as Employee) or LIST or ARRAY. In this change we standardize on LIST. Thus when EnumerableUncollect comes to generate code for

      select * from unnest(select employees from dept)

      it will know that employees is a list and each employee record is also a list.

      To do this we will need to convert (e.g. from an array of Employee objects) on the way in.

        Issue Links

          Activity

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/4000edd8 .
          Hide
          jcamachorodriguez Jesus Camacho Rodriguez added a comment -

          Resolved in release 1.5.0 (2015-11-10)

          Show
          jcamachorodriguez Jesus Camacho Rodriguez added a comment - Resolved in release 1.5.0 (2015-11-10)

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development