[ 
https://issues.apache.org/jira/browse/CALCITE-3716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17057444#comment-17057444
 ] 

Stamatis Zampetakis commented on CALCITE-3716:
----------------------------------------------

I had a quick look in the PR and I was wondering if the fix would be more 
appropriate at the Avatica level and not in its clients (in this case Calcite). 
The ResultSetMetadata API explicitly says to return an empty string for the 
following methods:

* getSchemaName
* getCatalogName
* getTableName  

For me this would mean that either the constructor of ColumnMetaData throws an 
exception when one of these values is null or automatically converts null to 
empty string for the methods above. I prefer the latter since with this 
approach apart from Calcite we may fix also other clients of Avatica. I am not 
pushing strongly about this I just wanted to hear your thoughts.

  

> ResultSetMetaData.getTableName should return empty string, not null, when 
> column does not map to a table
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-3716
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3716
>             Project: Calcite
>          Issue Type: Bug
>          Components: jdbc-driver
>    Affects Versions: 1.21.0
>            Reporter: Julian Hyde
>            Assignee: Jin Xing
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.23.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Per the [JDBC 
> spec|https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSetMetaData.html#getTableName-int-],
>  {{ResultSetMetaData.getTableName}} should return empty string, not null, 
> when column does not map to a table. Similarly getCatalogName, getSchemaName, 
> getColumnName.



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

Reply via email to