You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Wenrui Meng (Jira)" <ji...@apache.org> on 2022/06/21 18:49:00 UTC

[jira] [Assigned] (CALCITE-4471) "SqlBetweenOperator" should support writing optional "ASYMMETRIC" or "SYMMETRIC" flag in "unparse" method

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

Wenrui Meng reassigned CALCITE-4471:
------------------------------------

    Assignee: Wenrui Meng

> "SqlBetweenOperator" should support writing optional "ASYMMETRIC" or "SYMMETRIC" flag in "unparse" method
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4471
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4471
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>         Environment: jvm: open-jdk8
>            Reporter: yanjing.wang
>            Assignee: Wenrui Meng
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2021-01-18-15-51-40-245.png, image-2021-01-18-15-57-02-994.png, image-2021-01-18-15-57-22-436.png
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> when i unparse the following sql 
>  
> {code:java}
> String sql = "select concat(a.id,'-',b.id) , a.name from xxx.bb where dt between '2020-10-04' AND '2020-10-09' limit 2";
> {code}
> i got the result
>  
> {code:java}
> SELECT `CONCAT`(`A`.`ID`, '-', `B`.`ID`), `A`.`NAME` FROM `XXX`.`BB` WHERE `DS` BETWEEN ASYMMETRIC '2020-10-04' AND '2020-10-09' LIMIT 2
> {code}
> the "ASYMMETRIC" keyword is not supported in spark dialect. and the "parser.jj" file defines optional "ASYMMETRIC" and "SYMMETRIC" keyword.
> !image-2021-01-18-15-51-40-245.png!
> but "SqlBetweenOperator" writes the "flag" in hard code way.
> !image-2021-01-18-15-57-02-994.png!
> !image-2021-01-18-15-57-22-436.png!
> the parse and unparse should keep the same syntax process.
> my code is as follows
>  
> {code:java}
> String sql = "select concat(a.id,'-',b.id) , a.name from xxx.bb where dt between '2020-10-04' AND '2020-10-09' limit 2";  
> SqlParser sqlParser = SqlParser.create(sql, configBuilder); try { SqlNode sqlNode = sqlParser.parseQuery(); SqlString sqlString = sqlNode.toSqlString(SPARK); System.out.println(sqlString); } catch (SqlParseException e) { e.printStackTrace(); }
> {code}
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)