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

JdbcMeta pads the column names for MySQL with spaces.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: avatica-1.12.0
    • Fix Version/s: None
    • Component/s: avatica
    • Labels:
      None
    • Environment:

      My environment that confirmed this problem is as follows.

      • Avatica 1.12.0
      • MySQL 8.0.12
      • mysql-connector-java 8.0.12

      Description

      I tried to connect to Avatica's StandaloneServer using with Avatica remote JDBC driver. The column names which come out of AvaticaDatabaseMetaData#getColumns method are padded with spaces using with FixedStringAccessor. This problem is caused by JdbcMeta#getColumns method on the server side. Because DatabaseMetaData#getColumns method of MySQL JDBC driver returns 1 (java.sql.Types.CHAR) as the value of DATA_TYPE column.

      I want to get no-padding column names on the client side. How do I write the patches for this problem? Most simply patches is that it use StringAccessor as default CHAR accessor instead of FixedStringAccessor.

      https://github.com/apache/calcite-avatica/blob/rel/avatica-1.12.0/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L128

      But I think that this approach may be caused the unexpected side-effects.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yuusaku_tan Yuusaku Taniguchi
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: