impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4787: Optimize APPX MEDIAN() memory usage
Date Sat, 18 Feb 2017 02:34:25 GMT
Alex Behm has posted comments on this change.

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


Patch Set 4:

(6 comments)

I'm pretty happy with this patch.

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

Line 1025:   // can fit 10 times as many samples, up to a maximum of MAX_NUM_SAMPLES. We do
not
update references to '10'


Line 1026:   // allocate room for MAX_NUM_SAMPLES samples up front in order to conserve memory.
in order to -> to


Line 1031:   if (new_capacity * 2 >= MAX_NUM_SAMPLES) new_capacity = MAX_NUM_SAMPLES;
DCHECK_LT(state->capacity, new_capacity);

in case someone decides to significantly muck with the sampling constants such that this can
overflow


Line 1051:   // ReservoirSamples. Initially, the array has enough room for MAX_NUM_SAMPLES
/ 1000
update to reflect the new initial size


Line 1063:   *state = ReservoirSampleState<T>();
It would be clearer what's happening if we added a constructor for ReservoirSampleState that
initializes the struct fields. Right now, it appears that num_samples and source_size could
be uninitialized.


Line 1076:       // If the container is full, increase it's size by 10x.
update 10


-- 
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: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Taras Bobrovytsky <tbobrovytsky@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <marcel@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj@cloudera.com>
Gerrit-Reviewer: Mostafa Mokhtar <mmokhtar@cloudera.com>
Gerrit-Reviewer: Taras Bobrovytsky <tbobrovytsky@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message