You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2019/05/29 20:08:00 UTC

[jira] [Resolved] (CALCITE-3048) Improve how JDBC adapter deduces current schema on Redshift

     [ https://issues.apache.org/jira/browse/CALCITE-3048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-3048.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.20.0

Fixed in https://github.com/apache/calcite/commit/7429c25a178401bd49b74d96645ef4226fc228ce.

> Improve how JDBC adapter deduces current schema on Redshift
> -----------------------------------------------------------
>
>                 Key: CALCITE-3048
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3048
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.20.0
>
>
> Improve how JDBC adapter deduces current schema on Amazon Redshift or PostgreSQL. Until now, we either look at the schema connect-string parameter, or call {{Connection.getSchema()}} (on JDBC 4.1 and above). But in Redshift's JDBC driver, {{Connection.getSchema()}} always returns null.
> Now, if we know we are running against Redshift or PostgreSQL, we will execute a {{select current_schema()}} query to find the current schema.
> Similarly for {{Connection.getCatalog()}} and {{select current_database()}}.
> Without this fix, we sometimes call {{DatabaseMetaData.getTables}} with null or empty schema, and get tables from other schemas, resulting in a "Multiple entries with same key" error while populating a Guava ImmutableMap.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)