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

Jiajun Xie resolved CALCITE-6102.
---------------------------------
    Resolution: Fixed

> SqlWriter in SqlInsert's unparse start a list but does not end it
> -----------------------------------------------------------------
>
>                 Key: CALCITE-6102
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6102
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.35.0
>            Reporter: Mingcan Wang
>            Assignee: Mingcan Wang
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.37.0
>
>
> SqlWriter in SqlInsert's unparse() start a list but does not end it.
> There is a SparkSql :
> {code:java}
> with tmp as (select * from t1) insert into t2 select * from tmp {code}
> I know calcite doesn't support parse "CTE + DML" for now.
> But in some situation, I'll create a SqlNode like that.
> {code:java}
> SqlInsert sqlinsert;
> SqlWith sqlWith;
> // ....
> sqlWith.setOperand(1, sqlInsert);
> sqlWith.toString(); {code}
> if we put a SqlInsert into a SqlWith's body manually, when we unparse the 
> SqlWith , it will throw an Expception :
> {code:java}
> java.lang.IllegalArgumentException: Frame does not match current frame
>  
> at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
> at 
> org.apache.calcite.sql.pretty.SqlPrettyWriter.endList(SqlPrettyWriter.java:884)
> at org.apache.calcite.sql.SqlWith$SqlWithOperator.unparse(SqlWith.java:109) 
> {code}
>  



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

Reply via email to