Xurenhe created DRILL-8222:
------------------------------
Summary: 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
Reporter: Xurenhe
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)