You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chen (Jira)" <ji...@apache.org> on 2020/08/25 01:59:00 UTC
[jira] [Resolved] (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 ]
Danny Chen resolved CALCITE-4172.
---------------------------------
Fix Version/s: 1.26.0
Assignee: Danny Chen
Resolution: Fixed
Fixed in [468b111|https://github.com/apache/calcite/commit/468b111b3cae44efd31e60c4bafe0018c8821e9a], thanks for the PR, [~jamesstarr] ~
> 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
> Assignee: Danny Chen
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.26.0
>
> Time Spent: 50m
> 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)