[
https://issues.apache.org/jira/browse/CALCITE-3716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17029228#comment-17029228
]
Julian Hyde commented on CALCITE-3716:
--------------------------------------
I reviewed the JDBC spec and I agree with you that {{getColumnName}} behaves
differently than {{getTableName}}, {{getSchemaName}}, {{getCatalogName}}.
(If I had written the JDBC spec I would have done it differently, to make it
consistent with {{getTableName}}. But I didn't. Also, I wish they had spelled
out what is supposed to happen "if not applicable".)
So, let's continue to return the label, which may of course be null. If people
want to know whether a result set field maps onto a DB column they should see
whether {{getTableName}} returns empty string.
> 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
> Reporter: Julian Hyde
> Assignee: Jin Xing
> Priority: Major
> Labels: pull-request-available
> 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)