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

Zhen Chen resolved CALCITE-7335.
--------------------------------
    Fix Version/s: 1.42.0
       Resolution: Fixed

Fixed in 
[{{b12a9ce}}|https://github.com/apache/calcite/commit/b12a9cefb67eefdd3b24ca2ac5893afeb021b80f]
 

Thanks for review [~mbudiu] [~xuzifu666] [~nobigo] 

> RelToSqlConverter generate sql containing Scala subqueries includes redundant 
> parentheses
> -----------------------------------------------------------------------------------------
>
>                 Key: CALCITE-7335
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7335
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: xiong duan
>            Assignee: Zhen Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.42.0
>
>
> The UT in RelToSqlConverterTest:
> {code:java}
> @Test void testScalarSubqueryInSelectList() {
>   final String sql2 = "" +
>       "select\n" +
>       "        (SELECT\n" +
>       "          COUNT(*)\n" +
>       "        FROM\n" +
>       "           \"employee\"" +
>       "        WHERE\n" +
>       "           v.\"product_id\" >= 2), 3\n" +
>       "from \"product\" as v";
>   final String expected = "SELECT (((SELECT COUNT(*)\nFROM 
> \"foodmart\".\"employee\"\nWHERE \"product\".\"product_id\" >= 2))), 3\n" +
>       "FROM \"foodmart\".\"product\"";
>   sql(sql2).ok(expected);
> } {code}
> {code:java}
> (((SELECT COUNT(*)\nFROM \"foodmart\".\"employee\"\nWHERE 
> \"product\".\"product_id\" >= 2)))
> {code}
> should be:
> {code:java}
> (SELECT COUNT(*)\nFROM \"foodmart\".\"employee\"\nWHERE 
> \"product\".\"product_id\" >= 2){code}
> The result with redundant parentheses is correct but not sufficiently 
> standardized.



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

Reply via email to