You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Youwei Wang (Code Review)" <ge...@cloudera.org> on 2016/06/23 01:45:50 UTC

[Impala-CR](cdh5-trunk) IMPALA-889: Add support for ISO-SQL trim()

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

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(source_string, chars_to_trim, option);
source_string: the source string to trim;
chars_to_trim: the characters to trim, which is represented as a string;
option: enumerate values, available choices are: left/right/both:
  left means trimming characters from the start of the source string;
  right 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'.
Example:
  select btrim('abc%%defg%%%%%', 'a%', 'left'); returns 'bc%%defg%%%%%';
  select btrim('abc%%defg%%%%%', 'fg%', 'right'); returns 'abc%%de';
  select btrim('abc%%defg%%%%%', 'abfg%', 'both'); 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, 115 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/13/3213/3
-- 
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: 3
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Youwei Wang <yo...@intel.com>
Gerrit-Reviewer: Jim Apple <jb...@cloudera.com>