You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "jichen (Code Review)" <ge...@cloudera.org> on 2019/12/12 02:34:29 UTC

[Impala-ASF-CR] IMPALA-8891: concat ws() null handling is non-standard

Hello Csaba Ringhofer, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/14885

to look at the new patch set (#2).

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:
* Update test cases for function concat_ws,Ran expr-test locally.
* Ran exaustive tests locally.
* Ran full-scale tests on jenkins

Change-Id: I64cd3bfbb952e431a0cf52a5835ac05d2513d29b
---
M be/src/exprs/expr-test.cc
M be/src/exprs/string-functions-ir.cc
2 files changed, 68 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/85/14885/2
-- 
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: 2
Gerrit-Owner: jichen <ji...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>