255113 {
255114 auto &partition_offsets =
gstate.partition_offsets;
255115 const auto &aggr =
gstate.aggr;
255116 const auto chunk_begin = row;
255117 const auto chunk_end = chunk_begin + sink_chunk.size();
255119 idx_t(std::upper_bound(partition_offsets.begin(), partition_offsets.end(), row) - partition_offsets.begin()) -
255120 1;
255121
255122 auto state_f_data =
statef.GetData();
255123 auto state_p_data = FlatVector::GetData<data_ptr_t>(
statep);
255124
255125 auto &child_idx =
gstate.aggregator.child_idx;
255126 for (
column_t c = 0; c < child_idx.size(); ++c) {
255128 }
255129
255130 AggregateInputData aggr_input_data(aggr.GetFunctionData(),
statef.allocator);
255132 idx_t filter_idx = 0;
255133 auto partition_end = partition_offsets[
partition + 1];
255134 while (row < chunk_end) {
255135 if (row == partition_end) {
255137 partition_end = partition_offsets[
partition + 1];
255138 }
255139 partition_end = MinValue(partition_end, chunk_end);
255140 auto end = partition_end - chunk_begin;
255141
255143 if (filter_sel) {
255144
255145 SelectionVector sel;
255146
255147
255148 for (; filter_idx < filtered; ++filter_idx) {
255149 auto idx = filter_sel->get_index(filter_idx);
255150 if (idx >= begin) {
255151 break;
255152 }
255153 }
255154
255155
255156 sel.Initialize(filter_sel->data() + filter_idx);
255158 for (; filter_idx < filtered; ++filter_idx, ++nsel) {
255159 auto idx = filter_sel->get_index(filter_idx);
255160 if (idx >= end) {
255161 break;
255162 }
255163 }
255164
255165 if (nsel !=
inputs.size()) {
255167 }
255168 } else {
255169
255170 if (begin) {
255173 }
255174 } else {
255176 }
255177 inputs.SetCardinality(end - begin);
255178 }
255179
255180
255181 const auto count =
inputs.size();
255183 if (aggr.function.HasStateSimpleUpdateCallback()) {
255184 aggr.function.GetStateSimpleUpdateCallback()(
inputs.data.data(), aggr_input_data,
inputs.ColumnCount(),
255185 state, count);
255186 } else {
255187 state_p_data[0] = state_f_data[
partition];
255188 aggr.function.GetStateUpdateCallback()(
inputs.data.data(), aggr_input_data,
inputs.ColumnCount(),
statep,
255189 count);
255190 }
255191
255192
255193 row += end - begin;
255194 begin = end;
255195 }
255196}
vector< Vector > data
The vectors owned by the DataChunk.
Definition duckdb.hpp:11445
idx_t column_t
Type used for column identifiers.
Definition duckdb.hpp:259
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237