[
https://issues.apache.org/jira/browse/CALCITE-4556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stamatis Zampetakis resolved CALCITE-4556.
------------------------------------------
Resolution: Fixed
Fixed in
[f30f407654e150679ede6e8d8d4344e6dc26b346|https://github.com/apache/calcite/commit/f30f407654e150679ede6e8d8d4344e6dc26b346].
Thanks for the PR [~asolimando]!
> 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
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.27.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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)