Marcel Kornacker has posted comments on this change.

Change subject: IMPALA-4787: Optimize APPX_MEDIAN() memory usage
......................................................................


Patch Set 14:

(10 comments)

http://gerrit.cloudera.org:8080/#/c/6025/14/be/src/exprs/aggregate-functions-ir.cc
File be/src/exprs/aggregate-functions-ir.cc:

Line 908: const static int INIT_CAPACITY = 16;
move those constants into the classes that use them


Line 981: // stored in a dynamically sized array. See the ".h" file for more 
details.
briefly describe memory mgmt, in particular the switch to the inlined 
representation.

i didn't get the "see .h for more details part", is there anything relevant to 
this in there?


Line 1040:   // contains. Frees the memory of the current object. Requires a 
call Deserialize() call
fix grammar

point out that the array must not be inlined


Line 1062:     DCHECK(!sample_array_inline_);
dcheck this at the top, makes it easier to pick up on it.


Line 1085:   // reservoir sampling algorithm.
point out all side effects (increase of capacity; when that fails)


Line 1100:     // First, fill up the dst samples if they don't already exist. 
The samples are now
separate logically separate blocks with blank lines


Line 1124:     if (num_samples_ == 0) {
single line


Line 1138:   void Free(FunctionContext* ctx) {
call this Delete, because that's what it basically implements (free() only 
frees the memory directly allocated for that pointer)


Line 1151:   // resize occurs, this needs to be updated.
i'm assuming this is the size of the array. comment.


Line 1169:   // Increases the size of the samples array to a rounded up to a 
power of two
"array to new_capacity, rounded up to a power of two."


-- 
To view, visit http://gerrit.cloudera.org:8080/6025
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I99adaad574d4fb0a3cf38c6cbad8b2a23df12968
Gerrit-PatchSet: 14
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple-imp...@apache.org>
Gerrit-Reviewer: Marcel Kornacker <mar...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <m...@cloudera.com>
Gerrit-Reviewer: Mostafa Mokhtar <mmokh...@cloudera.com>
Gerrit-Reviewer: Taras Bobrovytsky <tbobrovyt...@cloudera.com>
Gerrit-HasComments: Yes

Reply via email to