You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "James Turton (Jira)" <ji...@apache.org> on 2022/05/27 05:55:00 UTC

[jira] [Closed] (DRILL-8222) Wrong function's implementation of concat_delim

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

James Turton closed DRILL-8222.
-------------------------------
    Resolution: Fixed

> Wrong function's implementation of concat_delim
> -----------------------------------------------
>
>                 Key: DRILL-8222
>                 URL: https://issues.apache.org/jira/browse/DRILL-8222
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.20.1
>            Reporter: Xurenhe
>            Priority: Major
>             Fix For: 1.20.2
>
>         Attachments: image-2022-05-11-19-07-28-586.png
>
>
> Current function implementation of `concat_delim` is wrong.
> {code:java}
> select concat_delim(',', 'a', null, 'b') as c {code}
> We may want the result of 'a,b', which ignore null value during executing.
>  
> But, actual result is 'a,,b'.
> I found the similar function(concat_ws) in MySQL and Postgres, and the behavior is what I wish.
>  
> ----
>  
> {code:java}
> @Test
> public void testConcatDelimVarArgsWithNullValue() throws Exception {
>   testBuilder()
>     .sqlQuery("select concat_delim(',', 'a', null, 'b') as c")
>     .unOrdered()
>     .baselineColumns("c")
>     .baselineValues("a,b")
>     .go();
> }
> {code}
> !image-2022-05-11-19-07-28-586.png|width=576,height=218!
>  



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