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/19 04:03:00 UTC

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

Benchao Li commented on CALCITE-5439:
-------------------------------------

[~volodymyr] Good catch, thanks the the reporting. You marked the fix version as '1.33.0', do you plan to open the PR in a few days? (Since we are about to release 1.33.0 recently)

NIT: I guess you are usingĀ {{SqlShuttle}} instead of {{RelShuttle}} while doing the deep copy, right?


> 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
>             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)