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

CalciteMetaImpl#createEmptyResultSet override of (Avatica) MetaImpl#createEmptyResultSet should not pass a class instance to CursorFactory#deduce

    XMLWordPrintableJSON

Details

    Description

      In Avatica 1.18.0, `CursorFactory#deduce(List<ColumnMetaData> columns, Class resultClazz)` introduces a validation step requiring the names appearing in the column metadata to match fields of `resultClazz`, whenever the class is not null.

      `CalciteMetaImpl#createEmptyResultSet` overrides `MetaImpl#createEmptyResultSet` (class from Avatica), only to pass a value non null value to the `resultClazz` argument.

      Column metadata column names for Calcite internal metadata classes (e.g., `MetaColumn`, `MetaCatalog`, `MetaSchema`, etc.) are built using `MetaImpl#fieldMetadata` (transforming the name from camel case into upper-snake case), violating the new contract of `deduce`.

      This is not problematic, because `deduce` is only used to create an empty result set, we are only interested in preserving the sought column names, which is already the case forĀ `MetaImpl#createEmptyResultSet`.

      `CalciteMetaImpl#createEmptyResultSet`, if adapted to match the changes coming from Avatica 1.18.0 would become identical to the `MetaImpl#createEmptyResultSet` it overrides, and it should therefore be removed.

      Attachments

        Issue Links

          Activity

            People

              asolimando Alessandro Solimando
              asolimando Alessandro Solimando
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 20m
                  20m