[
https://issues.apache.org/jira/browse/CALCITE-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17235115#comment-17235115
]
xzh_dz commented on CALCITE-4407:
---------------------------------
Open PR after fixing code.
> Support unparse special syntax when operator is DELETE
> ------------------------------------------------------
>
> Key: CALCITE-4407
> URL: https://issues.apache.org/jira/browse/CALCITE-4407
> Project: Calcite
> Issue Type: Wish
> Reporter: xzh_dz
> Priority: Major
> Labels: pull-request-available
> Attachments: image-2020-11-18-16-12-18-340.png
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> This exception can be reproduced as below:
> SqlParserTest:
> {code:java}
> // code placeholder
> @Test void testSqlDeleteSqlBasicCallToString() throws Exception {
> final String sql0 = "delete from emps";
> final SqlNode sqlNode0 = getSqlParser(sql0).parseStmt();
> final SqlNode sqlNodeVisited0 = sqlNode0.accept(new SqlShuttle() {
> @Override public SqlNode visit(SqlIdentifier identifier) {
> return new SqlIdentifier(identifier.names,
> identifier.getParserPosition());
> }
> });
> System.out.println(sqlNodeVisited0.toString());
> }{code}
> Exception:
> {code:java}
> // code placeholder
> java.lang.UnsupportedOperationException: class
> org.apache.calcite.sql.SqlSyntax$7:
> SPECIALjava.lang.UnsupportedOperationException: class
> org.apache.calcite.sql.SqlSyntax$7: SPECIAL
> at org.apache.calcite.util.Util.needToImplement(Util.java:1080) at
> org.apache.calcite.sql.SqlSyntax$7.unparse(SqlSyntax.java:128) at
> org.apache.calcite.sql.SqlOperator.unparse(SqlOperator.java:377) at
> org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:453) at
> org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:103) at
> org.apache.calcite.sql.SqlNode.toSqlString(SqlNode.java:155)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)