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

Function VisitGroupedValues

cpp/src/arrow/compute/kernels/hash_aggregate_internal.h:155–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153 requires std::is_void_v<
154 std::invoke_result_t<ConsumeValue, uint32_t, typename GetViewType<Type>::T>>
155void VisitGroupedValues(const ExecSpan& batch, ConsumeValue&& valid_func,
156 ConsumeNull&& null_func) {
157 auto g = batch[1].array.GetValues<uint32_t>(1);
158 if (batch[0].is_array()) {
159 VisitArrayValuesInline<Type>(
160 batch[0].array,
161 [&](typename TypeTraits<Type>::CType val) { valid_func(*g++, val); },
162 [&]() { null_func(*g++); });
163 return;
164 }
165 const Scalar& input = *batch[0].scalar;
166 if (input.is_valid) {
167 const auto val = UnboxScalar<Type>::Unbox(input);
168 for (int64_t i = 0; i < batch.length; i++) {
169 valid_func(*g++, val);
170 }
171 } else {
172 for (int64_t i = 0; i < batch.length; i++) {
173 null_func(*g++);
174 }
175 }
176}
177
178template <typename Type, typename ConsumeValue, typename ConsumeNull>
179 requires std::is_same_v<

Callers

nothing calls this directly

Calls 2

is_arrayMethod · 0.80
OKFunction · 0.50

Tested by

no test coverage detected