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

Method GetResult

cpp/src/arrow/compute/kernels/aggregate_mode.cc:135–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 Status GetResult(KernelContext* ctx, const DataType& type, ExecResult* out) {
136 // generator to emit next value:count pair
137 int index = 0;
138 auto gen = [&]() {
139 for (; index < static_cast<int>(counts.size()); ++index) {
140 if (counts[index] != 0) {
141 auto value_count =
142 std::make_pair(static_cast<CType>(index + this->min), counts[index]);
143 ++index;
144 return value_count;
145 }
146 }
147 return std::pair<CType, uint64_t>(0, kCountEOF);
148 };
149
150 return Finalize<T>(ctx, type, out, std::move(gen));
151 }
152
153 Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
154 // count values in all chunks, ignore nulls

Callers 1

dictionaryMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected