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 2020/08/13 18:54:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17177261#comment-17177261 ] 

Julian Hyde commented on CALCITE-4172:
--------------------------------------

I have trouble getting my head around the cause of this, but if it does not break anything else I have no problem with it.

The PR will need a little cleanup (formatting). Also, I'm not a fan of small standalone tests.

> 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
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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)