Youwei Wang has uploaded a new patch set (#9).

Change subject: IMPALA-889: Add support for ISO-SQL trim()
......................................................................

IMPALA-889: Add support for ISO-SQL trim()

Add support for an ISO-SQL compliant trim() function.
Syntax: select trim(option, chars_to_trim, source_string);
option: enumerate values, available choices are: 
left/leading/right/trailing/both:
  left/leading means trimming characters from the start of the source string;
  right/trailing means trimming characters from the end of the source string;
  both means trimming characters from both ends of the source string;
Note: option is case-insensitive, which means 'left' equals 'LeFt'.
chars_to_trim: the characters to trim, which is represented as a string;
source_string: the source string to trim;
Example:
  select btrim('left', 'a%', 'abc%%defg%%%%%'); returns 'bc%%defg%%%%%';
  select btrim('right', 'fg%', 'abc%%defg%%%%%'); returns 'abc%%de';
  select btrim('leading', 'ab%', 'abc%%defg%%%%%'); returns 'c%%defg%%%%%';
  select btrim('trailing', 'bfg%', 'abc%%defg%%%%%'); returns 'abc%%de';
  select btrim('both', 'abfg%', 'abc%%defg%%%%%'); returns 'c%%de';

Change-Id: I4753c608b0b00569bf8c5e95b132df6df358e602
---
M be/src/exprs/expr-test.cc
M be/src/exprs/string-functions-ir.cc
M be/src/exprs/string-functions.h
M common/function-registry/impala_functions.py
4 files changed, 145 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/13/3213/9
-- 
To view, visit http://gerrit.cloudera.org:8080/3213
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4753c608b0b00569bf8c5e95b132df6df358e602
Gerrit-PatchSet: 9
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Youwei Wang <[email protected]>
Gerrit-Reviewer: Jim Apple <[email protected]>
Gerrit-Reviewer: Youwei Wang <[email protected]>

Reply via email to