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

Julian Hyde commented on CALCITE-5265:
--------------------------------------

"Unparse" is a rather technical word (if it's even a word) that means "convert 
an AST back to SQL". The main (only?) reason that users would want to convert 
relational algebra or AST to SQL is if they're using the JDBC adapter. So, we 
generally describe bugs of this nature as "JDBC adapter" issues.

When describing bugs, it's harmless to be a little too specific (why say 
"overflow occurs when adding two large integers or subtracting a large negative 
integer from a large positive integer" when you can say "overflow occurs when 
adding two large integers"?) or too concrete, but if you are too abstract a 
large fraction of your audience won't understand what you're talking about. 

> JDBC adapter sometimes adds unnecessary parentheses around SELECT in INSERT
> ---------------------------------------------------------------------------
>
>                 Key: CALCITE-5265
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5265
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Mou Wu
>            Assignee: Mou Wu
>            Priority: Trivial
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Add a case in RelToSqlConverterTest:
> {code:java}
> // code placeholder
> @Test void testInsertValueWithDynamicParams() {
>   final String sql = "insert into \"DEPT\" values (?,?,?)";
>   final String expected = ""
>       + "INSERT INTO \"SCOTT\".\"DEPT\" (\"DEPTNO\", \"DNAME\", \"LOC\")\n"
>       + "SELECT ? AS \"DEPTNO\", ? AS \"DNAME\", ? AS \"LOC\"\n"
>       + "FROM (VALUES (0)) AS \"t\" (\"ZERO\")";
>   sql(sql)
>       .schema(CalciteAssert.SchemaSpec.JDBC_SCOTT)
>       .ok(expected);
> }{code}
> will fail, because actual sql is with parentheses, maybe it's all right with 
> parentheses, but the behavior is different from Union operator, you can see 
> testInsertValuesWithDynamicParams in RelToSqlConverterTest class.



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

Reply via email to