Dan Hecht has posted comments on this change. Change subject: IMPALA-4729: Implement REPLACE() ......................................................................
Patch Set 16: (9 comments) http://gerrit.cloudera.org:8080/#/c/5776/16/be/src/exprs/string-functions-ir.cc File be/src/exprs/string-functions-ir.cc: 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). http://gerrit.cloudera.org:8080/#/c/5776/16/be/src/udf/udf.cc File be/src/udf/udf.cc: 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; delete http://gerrit.cloudera.org:8080/#/c/5776/16/be/src/udf/udf.h 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. http://gerrit.cloudera.org:8080/#/c/5776/16/testdata/workloads/functional-query/queries/QueryTest/exprs.test 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 http://gerrit.cloudera.org:8080/5776 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1780a7d8fee6d0db9dad148217fb6eb10f773329 Gerrit-PatchSet: 16 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Zach Amsden <[email protected]> Gerrit-Reviewer: Alex Behm <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Michael Ho <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Reviewer: Zach Amsden <[email protected]> Gerrit-HasComments: Yes
