jichen has uploaded a new patch set (#7). (
http://gerrit.cloudera.org:8080/14885 )
Change subject: IMPALA-8891: concat_ws() null handling is non-standard
......................................................................
IMPALA-8891: concat_ws() null handling is non-standard
This patch fix the non-standard null handling logic for
function 'concat_ws', while maintain the original null
handing for function 'concat'
Existing statuses:
For function concat_ws, any null string element in array
argument strs will result in null result, just like below:
------------------------------------------------
select concat_ws('-','foo',null,'bar') as expr1;
+-------+
| expr1 |
+-------+
| NULL |
+-------+
New Statuses:
In this implementation, the function is conform to hive standard:
1.will join all the non-null string object as the result
2.if all string objects are null, return empty string
3.if separator is null, return null
below is a example:
-------------------------------------------------
select concat_ws('-','foo',null,'bar') as expr1;
+----------+
| expr1 |
+----------+
| foo-bar |
+----------+
------------------------------------------------
Key changes:
* Reimplement function StringFunctions::ConcatWs by filtering the null value
and only process the valid string values, based on original code structure.
* Since in the original implementation of function StringFunctions::ConCat,
it directly invoke function StringFunctions::ConcatWs. the changed behavior
of function StringFunctions::ConcatWs will also affect function
StringFunctions::ConCat, to maintain the original standard of function,
we also reimplement function StringFunctions::Concat.
Testing:
* Ran exaustive tests.
Change-Id: I64cd3bfbb952e431a0cf52a5835ac05d2513d29b
---
M be/src/exprs/expr-test.cc
M be/src/exprs/string-functions-ir.cc
2 files changed, 64 insertions(+), 18 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/85/14885/7
--
To view, visit http://gerrit.cloudera.org:8080/14885
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I64cd3bfbb952e431a0cf52a5835ac05d2513d29b
Gerrit-Change-Number: 14885
Gerrit-PatchSet: 7
Gerrit-Owner: jichen <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: jichen <[email protected]>