| 261 | } |
| 262 | |
| 263 | void 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 | |
| 284 | void PythonAggregate::registerAggregationFunction( |
| 285 | pybind11::object pyAggregatorClass, |