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

Method SampledNdvMerge

be/src/exprs/aggregate-functions-ir.cc:3161–3175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3159}
3160
3161void AggregateFunctions::SampledNdvMerge(FunctionContext* ctx, const StringVal& src,
3162 StringVal* dst) {
3163 SampledNdvState* src_state = reinterpret_cast<SampledNdvState*>(src.ptr);
3164 SampledNdvState* dst_state = reinterpret_cast<SampledNdvState*>(dst->ptr);
3165 for (int i = 0; i < SampledNdvState::NUM_HLL_BUCKETS; ++i) {
3166 StringVal src_hll = StringVal(src_state->buckets[i].hll, DEFAULT_HLL_LEN);
3167 StringVal dst_hll = StringVal(dst_state->buckets[i].hll, DEFAULT_HLL_LEN);
3168 HllMerge(ctx, src_hll, &dst_hll);
3169 dst_state->buckets[i].row_count += src_state->buckets[i].row_count;
3170 }
3171 // Total count. Not really needed after Update() but kept for sanity checking.
3172 dst_state->total_row_count += src_state->total_row_count;
3173 // Propagate sampling percent to Finalize().
3174 dst_state->sample_perc = src_state->sample_perc;
3175}
3176
3177BigIntVal AggregateFunctions::SampledNdvFinalize(FunctionContext* ctx,
3178 const StringVal& src) {

Callers

nothing calls this directly

Calls 2

StringValClass · 0.85
HllMergeFunction · 0.85

Tested by

no test coverage detected