Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.35.0
Description
SqlWriter in SqlInsert's unparse() start a list but does not end it.
There is a SparkSql :
with tmp as (select * from t1) insert into t2 select * from tmp
I know calcite doesn't support parse "CTE + DML" for now.
But in some situation, I'll create a SqlNode like that.
SqlInsert sqlinsert;
SqlWith sqlWith;
// ....
sqlWith.setOperand(1, sqlInsert);
sqlWith.toString();
if we put a SqlInsert into a SqlWith's body manually, when we unparse the SqlWith , it will throw an Expception :
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)
Attachments
Issue Links
- links to