impala-reviews mailing list archives

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

Change subject: IMPALA-4729: Implement REPLACE()

Patch Set 16:

File be/src/exprs/

PS16, Line 215: _
for structs we don't usually use the underscore (but we do for classes), so let's remove that
(even though it doesn't need to be accessed).
File be/src/udf/

PS16, Line 453: std::find(std::begin(local_allocations_), std::end(local_allocations_), ptr);
is this going to become a perf issue?

Line 520:     std::cout << "MAX_LENGTH, Trying to allocate " << len << std::endl;
File be/src/udf/udf.h:

Line 583:   /// buffers, and so don't need to be explicitly freed.
this isn't true in general, but it is true for StringVal's created via this constructor. 
Let's reword to be clearer about that:

The memory backing this StringVal is a local allocation (i.e. managed by Impala), and so doesn't
need to be explicitly freed.

Or something like that. See also the "Memory Management" for UDF comment above.

PS16, Line 586: StringVal
... StringVal that is backed by a local allocation...

since not all StringVal's are like that.

PS16, Line 591: allocated from the
              :   /// function context.
a local allocation.

FunctionContext has interfaces for non-local allocations as well. Note that the "local" terminology
is unfortunate, but it's what we currently have.
File testdata/workloads/functional-query/queries/QueryTest/exprs.test:

Line 1935: float_col) AS STRING) as x, string_col as y from functional.alltypes) v;
this could probably be formatted better

Line 1942: select sum(length(replace(y, '0', x))) from (select cast(round(float_col) AS STRING)
as x, string_col as y from functional.alltypes) v;
can you add line breaks to stay within 90 columns?

Line 1948: ---- QUERY
is the case of both 'search' and 'replace' non-constants interesting?

To view, visit
To unsubscribe, visit

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

View raw message