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

Method reduce

bolt/cudf/exec/HashAggregation.cpp:122–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 std::vector<std::unique_ptr<::cudf::column>> reduce(
123 const ::cudf::column_view& values) override {
124 std::unique_ptr<::cudf::scalar> outputScalar;
125 if (isStepWithRawInput()) {
126 // TODO: A mode to include null values in count aggregation.
127 outputScalar = std::make_unique<::cudf::numeric_scalar<int64_t>>(
128 values.size() - values.null_count(), true, stream_);
129 } else {
130 try {
131 outputScalar = ::cudf::reduce(
132 values,
133 *::cudf::make_sum_aggregation<::cudf::reduce_aggregation>(),
134 values.type(),
135 stream_);
136 } catch (const ::cudf::logic_error& e) {
137 BOLT_FAIL("Count aggregation failed: {}", e.what());
138 }
139 }
140 std::vector<std::unique_ptr<::cudf::column>> result;
141 result.emplace_back(
142 ::cudf::make_column_from_scalar(*outputScalar, 1, stream_));
143 return result;
144 }
145
146 std::vector<std::unique_ptr<::cudf::column>> finalize(
147 std::vector<std::unique_ptr<::cudf::column>>&& intermediateCols)

Callers

nothing calls this directly

Calls 5

reduceFunction · 0.85
null_countMethod · 0.80
sizeMethod · 0.45
typeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected