impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Youwei Wang (Code Review)" <ger...@cloudera.org>
Subject [Impala-CR](cdh5-trunk) IMPALA-889: Add support for ISO-SQL trim()
Date Sat, 25 Jun 2016 14:08:58 GMT
Youwei Wang has uploaded a new patch set (#7).

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%%%%%', 'ab%', 'leading'); returns 'c%%defg%%%%%';
  select btrim('abc%%defg%%%%%', 'bfg%', 'trailing'); 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, 138 insertions(+), 9 deletions(-)


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

Mime
View raw message