MCPcopy Create free account
hub / github.com/apache/impala / Update

Method Update

be/src/exec/incr-stats-util.cc:153–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void PerColumnStats::Update(const string& ndv, int64_t num_new_rows, double new_avg_width,
154 int32_t max_new_width, int64_t num_new_nulls, int64_t num_new_trues,
155 int64_t num_new_falses, const impala::TColumnValue& low_value_new,
156 const impala::TColumnValue& high_value_new) {
157 DCHECK_EQ(intermediate_ndv.size(), ndv.size()) << "Incompatible intermediate NDVs";
158 DCHECK_GE(num_new_rows, 0);
159 DCHECK_GE(max_new_width, 0);
160 DCHECK_GE(new_avg_width, 0);
161 DCHECK_GE(num_new_nulls, -1); // '-1' needed to be backward compatible
162 DCHECK_GE(num_trues, 0);
163 DCHECK_GE(num_falses, 0);
164 for (int j = 0; j < ndv.size(); ++j) {
165 intermediate_ndv[j] = ::max(intermediate_ndv[j], ndv[j]);
166 }
167 // Earlier the 'num_nulls' were initialized and persisted with '-1', this condition
168 // ensures metadata backward compatibility between releases
169 if (num_nulls >= 0) {
170 if (num_new_nulls >= 0) {
171 num_nulls += num_new_nulls;
172 } else {
173 num_nulls = -1;
174 }
175 }
176
177 num_trues += num_new_trues;
178 num_falses += num_new_falses;
179 max_width = ::max(max_width, max_new_width);
180 total_width += (new_avg_width * num_new_rows);
181 num_rows += num_new_rows;
182
183 UpdateLowValue(low_value_new);
184 UpdateHighValue(high_value_new);
185}
186
187void PerColumnStats::Finalize() {
188 ndv_estimate = AggregateFunctions::HllFinalEstimate(

Callers 15

HeartbeatMethod · 0.45
UpdateStateMethod · 0.45
SendTopicUpdateMethod · 0.45
SendHeartbeatMethod · 0.45
ResolveRequestPoolMethod · 0.45
SubmitForAdmissionMethod · 0.45
SetFrontendProfileMethod · 0.45
WaitForHmsEventMethod · 0.45

Calls 2

maxFunction · 0.85
sizeMethod · 0.45

Tested by 5

HeartbeatMethod · 0.36
UpdateStateMethod · 0.36
SendTopicUpdateMethod · 0.36
SendHeartbeatMethod · 0.36
TESTFunction · 0.36