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

[jira] [Created] (CALCITE-4503) Order of fields in records should follow that of the SQL types

Alessandro Solimando created CALCITE-4503:
---------------------------------------------

             Summary: Order of fields in records should follow that of the SQL types
                 Key: CALCITE-4503
                 URL: https://issues.apache.org/jira/browse/CALCITE-4503
             Project: Calcite
          Issue Type: Bug
          Components: avatica
    Affects Versions: 1.17.0
            Reporter: Alessandro Solimando
            Assignee: Alessandro Solimando
             Fix For: 1.18.0


When dealing with records coming from Java classes, Avatica relies on the order of fields coming from {{java.lang.Class#getFields}} instead of using the order defined in the underlying SQL data type:
 # [org.apache.calcite.avatica.MetaImpl#createGetter(int ordinal)|https://github.com/apache/calcite-avatica/blob/ba20936bb1387793f34ae489760ec0cdbe205e4e/core/src/main/java/org/apache/calcite/avatica/MetaImpl.java#L145]
 # [org.apache.calcite.avatica.util.RecordIteratorCursor#RecordIteratorCursor(Iterator<E> iterator, Class<E> clazz)|https://github.com/apache/calcite-avatica/blob/ba20936bb1387793f34ae489760ec0cdbe205e4e/core/src/main/java/org/apache/calcite/avatica/util/RecordIteratorCursor.java#L42]

This behaviour prevents the change of fields orders, and it's particularly problematic because {{#getFields}} is JVM-specific.

 



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