You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vova Vysotskyi (Jira)" <ji...@apache.org> on 2022/12/17 09:50:00 UTC

[jira] [Created] (CALCITE-5439) Validation of Pivot fails after creating a deep copy of SqlNode

Vova Vysotskyi created CALCITE-5439:
---------------------------------------

             Summary: Validation of Pivot fails after creating a deep copy of SqlNode
                 Key: CALCITE-5439
                 URL: https://issues.apache.org/jira/browse/CALCITE-5439
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.32.0
            Reporter: Vova Vysotskyi
            Assignee: Vova Vysotskyi
             Fix For: 1.33.0


When creating a deep copy of SqlNode with the Pivot operator, RelShuttle creates SqlBasicCall instead of SqlPivot, and such SqlNode fails when validating the query:
{noformat}
Caused by: java.lang.ClassCastException: org.apache.calcite.sql.SqlBasicCall cannot be cast to org.apache.calcite.sql.SqlPivot
	at org.apache.calcite.sql.validate.SqlValidatorImpl.registerFrom(SqlValidatorImpl.java:2389)
	at org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery(SqlValidatorImpl.java:2757)
	at org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery(SqlValidatorImpl.java:2696)
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1074)
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:782)
	at org.apache.calcite.prepare.PlannerImpl.validate(PlannerImpl.java:224)
	... 61 more
{noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)