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

Julian Hyde resolved CALCITE-2084.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.16.0

Fixed in 
[26b4712d|http://git-wip-us.apache.org/repos/asf/calcite/commit/26b4712d]; 
thanks for the PR, [~vvysotskyi]!

> SqlValidatorImpl.findTable() method incorrectly handles table schema with few 
> schema levels
> -------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2084
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2084
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Volodymyr Vysotskyi
>            Assignee: Julian Hyde
>             Fix For: 1.16.0
>
>
> [{{SqlValidatorImpl.findTable()}}|https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L3423]
>  method contains code
> {code:java}
>     String schemaName = names.get(0);
>     String tableName = names.get(1);
>     CalciteSchema schema = 
> catalogReader.getRootSchema().getSubSchemaMap().get(schemaName);
>     if (schema == null) {
>       return null;
>     }
>     CalciteSchema.TableEntry entry = schema.getTable(tableName,
>             catalogReader.nameMatcher().isCaseSensitive());
> {code}
> where {{names}} is a list with schema paths and table name. 
> For the cases when a table in the schema, which nested into another schema 
> (schema1.schema2.table, etc), a required table could not be found.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to