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 2015/02/18 22:33:11 UTC

[jira] [Resolved] (CALCITE-593) Validator in Frameworks should expand identifiers

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

Julian Hyde resolved CALCITE-593.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.1.0-incubating

Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/f9db1ee9.

> Validator in Frameworks should expand identifiers
> -------------------------------------------------
>
>                 Key: CALCITE-593
>                 URL: https://issues.apache.org/jira/browse/CALCITE-593
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Jinfeng Ni
>            Assignee: Julian Hyde
>             Fix For: 1.1.0-incubating
>
>
> Calcite supports two ways to build query plan for a SQL statement. Either submit the query through JDBC, which will use CalcitePrepareImpl class, or build a customized planner by leveraging the Frameworks/PlannerImpl class. However, the SqlValidator created in Frameworks/PlannerImpl uses a different setting in terms of identifier expanding, than the setting in the SqlValidator in CalcitePrepareImpl.  This implies that one same query goes through those two SqlValidators would have different validated forms.
> SqlValidator.expandIdentifiers in by default is set to false. But CalcitePrepareImpl.prepare() will reset it to true at CalcitePrepareImpl:494: 
> {code}
>       final SqlValidator validator =
>           new CalciteSqlValidator(opTab, catalogReader, typeFactory);
>       validator.setIdentifierExpansion(true);
> {code}
> In contrast, the SqlValidator created in Frameworks/PlannerImpl will still use the default "false" setting. 
> Further, Frameworks does not expose the instance of SqlValidator, so user does not have a way to change the setting for the SqlValidator created in Frameworks/PlannerImpl.
> To make behaviors consistent, I would like to propose that we make Framework's SqlValidator uses the same setting as the one in CalcitePrepareImpl.
>  
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)