Yuusaku Taniguchi created CALCITE-2665:
------------------------------------------
Summary: JdbcMeta pads the column names for MySQL with spaces.
Key: CALCITE-2665
URL: https://issues.apache.org/jira/browse/CALCITE-2665
Project: Calcite
Issue Type: Bug
Components: avatica
Affects Versions: avatica-1.12.0
Environment: My environment that confirmed this problem is as follows.
- Avatica 1.12.0
- MySQL 8.0.12
- mysql-connector-java 8.0.12
Reporter: Yuusaku Taniguchi
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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)