You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "xiong duan (Jira)" <ji...@apache.org> on 2025/01/23 18:59:00 UTC

[jira] [Commented] (CALCITE-6303) UNION with CTE(s) results in exception during query validation

    [ https://issues.apache.org/jira/browse/CALCITE-6303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17916503#comment-17916503 ] 

xiong duan commented on CALCITE-6303:
-------------------------------------

Fixed in [28e0ab2|https://github.com/apache/calcite/commit/28e0ab23a32b70a8da27b7db472527d8265bcf43]. Thanks for the review [~zhehu] [~mbudiu] and [~caicancai] .

> UNION with CTE(s) results in exception during query validation
> --------------------------------------------------------------
>
>                 Key: CALCITE-6303
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6303
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.36.0
>            Reporter: Austin Richardson
>            Assignee: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>
> Attempting to execute a query that includes a UNION with CTE(s) in one of its operands results in a ClassCastException during query validation.
>  
> Example query:
>  
> {code:java}
> ( SELECT 123 )
> UNION
> ( WITH t (col) AS (VALUES (456)) SELECT col FROM t ) {code}
>  
> Snippet from resulting exception:
>  
> {code:java}
> java.lang.ClassCastException: class org.apache.calcite.sql.SqlNodeList cannot be cast to class org.apache.calcite.sql.SqlCall
>     at org.apache.calcite.sql.validate.SqlValidatorImpl.deduceModality(SqlValidatorImpl.java:4093){code}



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