MCPcopy Create free account
hub / github.com/apache/arrow / Finalize

Method Finalize

cpp/src/arrow/compute/kernels/aggregate_basic.cc:124–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 Status Finalize(KernelContext* ctx, Datum* out) override {
125 const auto& state = checked_cast<const CountImpl&>(*ctx->state());
126 switch (state.options.mode) {
127 case CountOptions::ONLY_VALID:
128 case CountOptions::ALL:
129 // ALL is equivalent since we don't count the null/non-null
130 // separately to avoid potentially computing null count
131 *out = Datum(state.non_nulls);
132 break;
133 case CountOptions::ONLY_NULL:
134 *out = Datum(state.nulls);
135 break;
136 default:
137 DCHECK(false) << "unreachable";
138 }
139 return Status::OK();
140 }
141
142 CountOptions options;
143 int64_t non_nulls = 0;

Callers 3

AggregateFinalizeFunction · 0.45
AddFirstOrLastAggKernelFunction · 0.45
AddMinOrMaxAggKernelFunction · 0.45

Calls 3

DatumClass · 0.50
OKFunction · 0.50
stateMethod · 0.45

Tested by

no test coverage detected