MCPcopy Create free account
hub / github.com/bytedance/bolt / extractAccumulators

Method extractAccumulators

bolt/python/Aggregate.cpp:213–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void PythonAggregate::extractAccumulators(
214 char** groups,
215 int32_t numGroups,
216 VectorPtr* result) {
217 if (numGroups == 0) {
218 return;
219 }
220
221 pybind11::object** accumulators = asIntermediatePtrTypes(**result);
222 uint64_t* rawNulls = getRawNulls(result->get());
223
224 for (int32_t i = 0; i < numGroups; ++i) {
225 char* group = groups[i];
226 if (isNull(group)) {
227 bits::setBit(rawNulls, i);
228 } else {
229 bits::clearBit(rawNulls, i);
230 accumulators[i] = value<std::unique_ptr<pybind11::object>>(group)->get();
231 }
232 }
233}
234
235void PythonAggregate::addSingleGroupIntermediateResults(
236 char* group,

Callers

nothing calls this directly

Calls 5

asIntermediatePtrTypesFunction · 0.85
isNullFunction · 0.85
clearBitFunction · 0.85
setBitFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected