You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "xiong duan (Jira)" <ji...@apache.org> on 2023/06/13 03:11:00 UTC

[jira] [Commented] (CALCITE-5774) withCaseClausesOnNewLines(true) creates invalid string literal

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

xiong duan commented on CALCITE-5774:
-------------------------------------

[~MasseGuillaume] Hi, I am confused when we set this configuration withCaseClausesOnNewLines to false, The SQL Will be different? I remember this configuration works on 
SqlWriter. Looks like this 'bar   ' is generated by the type coercions.

> withCaseClausesOnNewLines(true) creates invalid string literal
> --------------------------------------------------------------
>
>                 Key: CALCITE-5774
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5774
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: Guillaume Massé
>            Priority: Major
>
> It tries incorrectly to align ending quotes:
>  
> input:
>  
> {code:java}
> select f(case when a = 0 then 'foobar' when a = 1 then 'bar' else 'baz' end){code}
>  
>  
> output:
> {code:java}
> select f(case 
>     when a = 0 then 'foobar' 
>     when a = 1 then 'bar   '
>     else 'baz'
>     end){code}
>  
> expected:
> {code:java}
> select f(case 
>   when a = 0 then 'foobar' 
>   when a = 1 then 'bar'
>   else 'baz'
>   end){code}
>  



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