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

Method extractValues

bolt/python/Aggregate.cpp:263–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void PythonAggregate::extractValues(
264 char** groups,
265 int32_t numGroups,
266 VectorPtr* result) {
267 if (numGroups == 0) {
268 return;
269 }
270
271 for (int32_t i = 0; i < numGroups; ++i) {
272 char* group = groups[i];
273 if (isNull(group)) {
274 (*result)->setNull(i, true);
275 } else {
276 auto& accumulator = *value<std::unique_ptr<pybind11::object>>(group);
277 pybind11::object pyVal = reduce(*accumulator);
278 BOLT_DYNAMIC_SCALAR_TYPE_DISPATCH(
279 ::setValueAt, resultType()->kind(), **result, i, pyVal);
280 }
281 }
282}
283
284void PythonAggregate::registerAggregationFunction(
285 pybind11::object pyAggregatorClass,

Callers

nothing calls this directly

Calls 4

isNullFunction · 0.85
reduceFunction · 0.85
setNullMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected