hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Zotov <>
Subject concat_ws() UDF
Date Thu, 26 Dec 2013 11:36:28 GMT
Hello Guys,

historically concat_ws() UDF was added in the scope of ticket. I have a simple
question about its implementation. According to above ticket's description
it should have behavior like MySQL implementation (
MySQL documentation says:
not skip empty strings. However, it does skip any NULL values after the
separator argument.". I have performed a simple test:

> create table test (col1 string);
> select concat_ws(',', '10', NULL, '4', '', 'a') from test limit 1;

as a result I have got:

> 10,4,,a

which looks good for me.

But in tests (
78 line) I see the following lines:

POSTHOOK: query: SELECT concat_ws(dest1.c1, dest1.c2, dest1.c3),
>        concat_ws(',', dest1.c1, dest1.c2, dest1.c3),
>        concat_ws(NULL, dest1.c1, dest1.c2, dest1.c3),
>        concat_ws('**', dest1.c1, *NULL*, dest1.c3) FROM dest1
> POSTHOOK: Input: default@dest1
> #### A masked pattern was here ####
> POSTHOOK: Lineage: dest1.c1 SIMPLE []
> POSTHOOK: Lineage: dest1.c2 SIMPLE []
> POSTHOOK: Lineage: dest1.c3 SIMPLE []
> xyzabc8675309        abc,xyz,8675309        NULL        abc****8675309

which looks like NULLs are not skipped.

What have I missed?

Thanks, Alexey.

View raw message