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

Improve handling of ARRAY, MULTISET, STRUCT types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0
    • None
    • 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.

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: