impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taras Bobrovytsky (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4787: Optimize APPX MEDIAN() memory usage
Date Tue, 14 Mar 2017 01:57:00 GMT
Taras Bobrovytsky has posted comments on this change.

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

Patch Set 14:

File be/src/exprs/

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 repre
The description of the reservoir sample algorithm is there. Removed.

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

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 

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
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I99adaad574d4fb0a3cf38c6cbad8b2a23df12968
Gerrit-PatchSet: 14
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Taras Bobrovytsky <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Jim Apple <>
Gerrit-Reviewer: Marcel Kornacker <>
Gerrit-Reviewer: Matthew Jacobs <>
Gerrit-Reviewer: Mostafa Mokhtar <>
Gerrit-Reviewer: Taras Bobrovytsky <>
Gerrit-HasComments: Yes

View raw message