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

Function NaiveSum

cpp/src/arrow/compute/kernels/aggregate_test.cc:99–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98template <typename ArrowType>
99static Datum NaiveSum(const Array& array) {
100 using SumType = typename FindAccumulatorType<ArrowType>::Type;
101 using SumScalarType = typename TypeTraits<SumType>::ScalarType;
102
103 auto result = NaiveSumPartial<ArrowType>(array);
104 bool is_valid = result.second > 0;
105
106 if (!is_valid) return Datum(std::make_shared<SumScalarType>());
107 return Datum(std::make_shared<SumScalarType>(result.first));
108}
109
110void ValidateSum(
111 const Datum input, Datum expected,

Callers

nothing calls this directly

Calls 1

DatumClass · 0.50

Tested by

no test coverage detected