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/22 00:59:00 UTC

[jira] [Assigned] (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:all-tabpanel ]

xiong duan reassigned CALCITE-6303:
-----------------------------------

    Assignee: xiong duan

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