message: Issue Sorted Aggregate Scans
  Use Scans correctly (with Reset()).
diff: @@ -64,8 +64,9 @@ struct SortedAggregateBindData : public FunctionData {
  AggregateFunction function;
  vector<LogicalType> arg_types;
  unique_ptr<FunctionData> bind_info;
  - vector<LogicalType> sort_types;
  +
  vector<BoundOrderByNode> orders;
  + vector<LogicalType> sort_types;
  };
  struct SortedAggregateState {
  @@ -74,12 +75,6 @@ struct SortedAggregateState {
  SortedAggregateState() : nsel(0) {
  }
  - unique_ptr<ColumnDataCollection> arguments;
  - unique_ptr<ColumnDataCollection> ordering;
  -
  - DataChunk sort_buffer;
  - DataChunk arg_buffer;
  -
  static inline void InitializeBuffer(DataChunk &chunk, const vector<LogicalType> &types) {
  if (!chunk.ColumnCount() && !types.empty()) {
  chunk.Initialize(Allocator::DefaultAllocator(), types);
  @@ -154,10 +149,13 @@ struct SortedAggregateState {
  void Finalize(LocalSortState &local_sort) {
  if (ordering) {
  - const auto chunk_count = ordering->ChunkCount();
  - for (idx_t chunk_idx = 0; chunk_idx < chunk_count; ++chunk_idx) {
  - ordering->FetchChunk(chunk_idx, sort_buffer);
  - arguments->FetchChunk(chunk_idx, arg_buffer);
  + ColumnDataScanState sort_state;
  + ordering->InitializeScan(sort_state);
  + ColumnDataScanState arg_state;
  + arguments->InitializeScan(arg_state);
  + for (sort_buffer.Reset(); ordering->Scan(sort_state, sort_buffer); sort_buffer.Reset()) {
  + arg_buffer.Reset();
  + arguments->Scan(arg_state, arg_buffer);
  local_sort.SinkChunk(sort_buffer, arg_buffer);
  }
  ordering->Reset();
  @@ -167,6 +165,12 @@ struct SortedAggregateState {
  }
  }
  + unique_ptr<ColumnDataCollection> arguments;
  + unique_ptr<ColumnDataCollection> ordering;
  +
  + DataChunk sort_buffer;
  + DataChunk arg_buffer;
  +
  // Selection for scattering
  SelectionVector sel;
  idx_t nsel;
  