You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "James Starr (Jira)" <ji...@apache.org> on 2020/08/12 19:59:00 UTC

[jira] [Updated] (CALCITE-4172) SqlValidatorImpl.validateGroupClause should expand identifiers before resolving them against the catalog

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

James Starr updated CALCITE-4172:
---------------------------------
    Summary: SqlValidatorImpl.validateGroupClause should expand identifiers before resolving them against the catalog  (was: SqlValidatorImpl.validateGroupClause attempts to resolve parts of the group by clause before expanding)

> SqlValidatorImpl.validateGroupClause should expand identifiers before resolving them against the catalog
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4172
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4172
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: James Starr
>            Priority: Major
>
> I am attempt to support a Linq style syntax where you can 'dot' into a complex element.  In order to do this I am attempt to use SqlValidatorImpl.expand and related functions to rewrite the columnar identifiers before they are validated.
> SqlValidatorImpl.validateGroupClause calls SqlValidatorImpl.inferUnknownTypes which attempts to resolve the identifiers against the catalog.  Every where else that I am aware of first expands the identifier if configured to before resolving.
> SqlValidatorImpl.validateGroupClause immediately after calling inferUnknownTypes expands the identifiers.
> {code:java}
> org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4470) at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4470) at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:364) at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5220) at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5183) at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:344) at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1602) at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1587) at org.apache.calcite.sql.type.InferTypes$1.inferOperandTypes(InferTypes.java:52) at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1773) at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1738) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateGroupClause(SqlValidatorImpl.java:3576) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3201) at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:943) at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:924) at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:226){code}
>  



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