You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Alessandro Solimando (Jira)" <ji...@apache.org> on 2021/03/28 10:27:00 UTC

[jira] [Created] (CALCITE-4556) CalciteMetaImpl#createEmptyResultSet override of (Avatica) MetaImpl#createEmptyResultSet should not pass a class instance to CursorFactory#deduce

Alessandro Solimando created CALCITE-4556:
---------------------------------------------

             Summary: CalciteMetaImpl#createEmptyResultSet override of (Avatica) MetaImpl#createEmptyResultSet should not pass a class instance to CursorFactory#deduce
                 Key: CALCITE-4556
                 URL: https://issues.apache.org/jira/browse/CALCITE-4556
             Project: Calcite
          Issue Type: Bug
          Components: jdbc-driver
    Affects Versions: 1.26.0
            Reporter: Alessandro Solimando
            Assignee: Alessandro Solimando
             Fix For: 1.27.0


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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)