jichen has uploaded this change for review. (
http://gerrit.cloudera.org:8080/14885
Change subject: IMPALA-8891 concat_ws() null handling is non-standard
This patch is for IMPALA-8891,in the original implementation of function
concat_ws, any null string element in array argument strs will result in null
result,as it is shown below: --
......................................................................
IMPALA-8891 concat_ws() null handling is non-standard
This patch is for IMPALA-8891,in the original implementation of
function concat_ws, any null string element in array argument strs will result
in null result,as it is shown below:
------------------------------------------------
select concat_ws('-','foo',null,'bar') as expr1;
+-------+
| expr1 |
+-------+
| NULL |
+-------+
in this new implementation, the function is conform to hive
standard,like below:
-------------------------------------------------
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 full scale tests.
* 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(+), 12 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/85/14885/1
--
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: newchange
Gerrit-Change-Id: I64cd3bfbb952e431a0cf52a5835ac05d2513d29b
Gerrit-Change-Number: 14885
Gerrit-PatchSet: 1
Gerrit-Owner: jichen <[email protected]>