| 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) |
nothing calls this directly
no test coverage detected