impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Ho (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4729: Implement REPLACE()
Date Tue, 24 Jan 2017 07:20:35 GMT
Michael Ho has posted comments on this change.

Change subject: IMPALA-4729: Implement REPLACE()

Patch Set 2:

File be/src/exprs/

PS2, Line 221: // First pass - find matches to compute output size
A high level question: for very long string, is a two pass algorithm better than a one pass
approach in which one just keep appending to the result string as we find matches in the haystack

PS2, Line 237: int rlen = num_matches * (replace.len - needle.len) + str.len;
Can this overflow with a malicious replacement string ?

PS2, Line 249: DCHECK(match_pos_in_substring >= 0);
File fe/src/main/cup/sql-parser.cup:

PS2, Line 2955: ident_or_restricted:ident
Not sure if dotted_path is the right place to modify as it's used at other places too. Ideally
we should limit "replace" to be accepted as  function_names only but not for say database
/ table / column names.

PS2, Line 3050: ident_or_restricted 
May want to hide this as function_name's definition only to avoid others from using it if

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I1780a7d8fee6d0db9dad148217fb6eb10f773329
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Zach Amsden <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Michael Ho <>
Gerrit-HasComments: Yes

View raw message