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

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

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

Benchao Li resolved CALCITE-5439.
---------------------------------
    Resolution: Fixed

Fixed via [https://github.com/apache/calcite/commit/81efd2adf38af629cf2bab0cba081e0b47ba4a1f]

 

[~volodymyr] Thanks for the PR!

> 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
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.33.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> When creating a deep copy of SqlNode with the Pivot operator, SqlShuttle 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)