duckdb 0.7.2-dev2233.0 → 0.7.2-dev2320.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/binding.gyp +1 -0
  2. package/package.json +1 -1
  3. package/src/duckdb/src/catalog/catalog.cpp +18 -17
  4. package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +0 -4
  5. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +0 -4
  6. package/src/duckdb/src/catalog/catalog_set.cpp +3 -3
  7. package/src/duckdb/src/common/adbc/adbc.cpp +441 -0
  8. package/src/duckdb/src/common/adbc/driver_manager.cpp +749 -0
  9. package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +1 -1
  10. package/src/duckdb/src/common/tree_renderer.cpp +3 -3
  11. package/src/duckdb/src/common/types/conflict_manager.cpp +2 -1
  12. package/src/duckdb/src/execution/column_binding_resolver.cpp +1 -1
  13. package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +1 -1
  14. package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +2 -2
  15. package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +2 -2
  16. package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +5 -5
  17. package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +1 -1
  18. package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +11 -10
  19. package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +3 -3
  20. package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +9 -9
  21. package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +4 -4
  22. package/src/duckdb/src/execution/operator/join/physical_join.cpp +7 -7
  23. package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +3 -3
  24. package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +3 -3
  25. package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +2 -2
  26. package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +8 -9
  27. package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +20 -19
  28. package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +3 -3
  29. package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +25 -24
  30. package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +1 -1
  31. package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +2 -2
  32. package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +12 -6
  33. package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +10 -11
  34. package/src/duckdb/src/execution/operator/set/physical_union.cpp +2 -2
  35. package/src/duckdb/src/execution/physical_operator.cpp +13 -13
  36. package/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp +2 -4
  37. package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
  38. package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +5 -5
  39. package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +3 -3
  40. package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +6 -7
  41. package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +2 -4
  42. package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +2 -2
  43. package/src/duckdb/src/execution/physical_plan/plan_show_select.cpp +2 -4
  44. package/src/duckdb/src/execution/physical_plan/plan_update.cpp +3 -3
  45. package/src/duckdb/src/function/compression_config.cpp +9 -9
  46. package/src/duckdb/src/function/scalar/date/strftime.cpp +1 -1
  47. package/src/duckdb/src/function/table/copy_csv.cpp +5 -0
  48. package/src/duckdb/src/function/table/pragma_detailed_profiling_output.cpp +6 -5
  49. package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +7 -5
  50. package/src/duckdb/src/function/table/system/duckdb_databases.cpp +1 -1
  51. package/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +1 -1
  52. package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +1 -1
  53. package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +1 -1
  54. package/src/duckdb/src/function/table/system/duckdb_keywords.cpp +1 -1
  55. package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +1 -1
  56. package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +1 -1
  57. package/src/duckdb/src/function/table/system/duckdb_settings.cpp +1 -1
  58. package/src/duckdb/src/function/table/system/duckdb_tables.cpp +1 -1
  59. package/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp +1 -1
  60. package/src/duckdb/src/function/table/system/duckdb_types.cpp +1 -1
  61. package/src/duckdb/src/function/table/system/pragma_collations.cpp +1 -1
  62. package/src/duckdb/src/function/table/system/pragma_database_size.cpp +1 -1
  63. package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +5 -5
  64. package/src/duckdb/src/function/table/system/pragma_table_info.cpp +1 -1
  65. package/src/duckdb/src/function/table/system/test_all_types.cpp +1 -1
  66. package/src/duckdb/src/function/table/table_scan.cpp +3 -4
  67. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  68. package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +3 -3
  69. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +1 -2
  70. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +1 -2
  71. package/src/duckdb/src/include/duckdb/common/adbc/adbc-init.hpp +37 -0
  72. package/src/duckdb/src/include/duckdb/common/adbc/adbc.h +1088 -0
  73. package/src/duckdb/src/include/duckdb/common/adbc/adbc.hpp +85 -0
  74. package/src/duckdb/src/include/duckdb/common/adbc/driver_manager.h +84 -0
  75. package/src/duckdb/src/include/duckdb/common/helper.hpp +3 -0
  76. package/src/duckdb/src/include/duckdb/common/types/conflict_manager.hpp +3 -2
  77. package/src/duckdb/src/include/duckdb/common/types.hpp +0 -1
  78. package/src/duckdb/src/include/duckdb/execution/executor.hpp +7 -7
  79. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +1 -1
  80. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +1 -1
  81. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +1 -1
  82. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +3 -3
  83. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_index_join.hpp +1 -1
  84. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +1 -1
  85. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +1 -1
  86. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +2 -1
  87. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +2 -2
  88. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +1 -1
  89. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +2 -2
  90. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +3 -4
  91. package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +1 -1
  92. package/src/duckdb/src/include/duckdb/execution/operator/set/physical_union.hpp +1 -1
  93. package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +3 -3
  94. package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +1 -1
  95. package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +1 -1
  96. package/src/duckdb/src/include/duckdb/main/config.hpp +2 -2
  97. package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +10 -9
  98. package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +4 -4
  99. package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +18 -17
  100. package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +2 -2
  101. package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +14 -17
  102. package/src/duckdb/src/include/duckdb/planner/binder.hpp +6 -6
  103. package/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp +4 -4
  104. package/src/duckdb/src/include/duckdb/planner/expression_binder/where_binder.hpp +2 -2
  105. package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +3 -2
  106. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +2 -2
  107. package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +2 -2
  108. package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +2 -2
  109. package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +2 -2
  110. package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_function_info.hpp +3 -2
  111. package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +3 -2
  112. package/src/duckdb/src/include/duckdb/planner/table_binding.hpp +6 -5
  113. package/src/duckdb/src/include/duckdb/planner/tableref/bound_basetableref.hpp +2 -2
  114. package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_compress.hpp +3 -7
  115. package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_compress.hpp +3 -7
  116. package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
  117. package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +1 -1
  118. package/src/duckdb/src/include/duckdb/storage/table/column_data_checkpointer.hpp +2 -1
  119. package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +2 -2
  120. package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +1 -1
  121. package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +1 -1
  122. package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +4 -4
  123. package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +3 -3
  124. package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +3 -3
  125. package/src/duckdb/src/include/duckdb/transaction/commit_state.hpp +5 -5
  126. package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +3 -3
  127. package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +31 -30
  128. package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +2 -1
  129. package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
  130. package/src/duckdb/src/main/client_context.cpp +1 -1
  131. package/src/duckdb/src/main/query_profiler.cpp +24 -22
  132. package/src/duckdb/src/parallel/executor.cpp +55 -49
  133. package/src/duckdb/src/parallel/meta_pipeline.cpp +5 -5
  134. package/src/duckdb/src/parallel/pipeline.cpp +43 -26
  135. package/src/duckdb/src/parallel/pipeline_executor.cpp +22 -22
  136. package/src/duckdb/src/planner/bind_context.cpp +67 -71
  137. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +6 -7
  138. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -8
  139. package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +3 -4
  140. package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +17 -18
  141. package/src/duckdb/src/planner/binder/statement/bind_update.cpp +16 -17
  142. package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +6 -5
  143. package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +9 -9
  144. package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +20 -18
  145. package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +1 -1
  146. package/src/duckdb/src/planner/binder.cpp +4 -4
  147. package/src/duckdb/src/planner/expression_binder/index_binder.cpp +2 -1
  148. package/src/duckdb/src/planner/expression_binder/where_binder.cpp +3 -2
  149. package/src/duckdb/src/planner/operator/logical_create_table.cpp +1 -1
  150. package/src/duckdb/src/planner/operator/logical_delete.cpp +5 -5
  151. package/src/duckdb/src/planner/operator/logical_insert.cpp +6 -7
  152. package/src/duckdb/src/planner/operator/logical_update.cpp +6 -7
  153. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -5
  154. package/src/duckdb/src/planner/table_binding.cpp +6 -5
  155. package/src/duckdb/src/storage/compression/bitpacking.cpp +5 -6
  156. package/src/duckdb/src/storage/compression/dictionary_compression.cpp +5 -6
  157. package/src/duckdb/src/storage/compression/fsst.cpp +3 -5
  158. package/src/duckdb/src/storage/compression/rle.cpp +4 -6
  159. package/src/duckdb/src/storage/data_table.cpp +27 -28
  160. package/src/duckdb/src/storage/local_storage.cpp +70 -68
  161. package/src/duckdb/src/storage/storage_manager.cpp +12 -13
  162. package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +2 -2
  163. package/src/duckdb/src/storage/table/column_data.cpp +2 -2
  164. package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +18 -6
  165. package/src/duckdb/src/storage/table/column_segment.cpp +23 -24
  166. package/src/duckdb/src/storage/table/row_group.cpp +3 -3
  167. package/src/duckdb/src/storage/table/row_group_collection.cpp +1 -1
  168. package/src/duckdb/src/storage/table/update_segment.cpp +15 -15
  169. package/src/duckdb/src/storage/wal_replay.cpp +1 -1
  170. package/src/duckdb/src/transaction/cleanup_state.cpp +10 -10
  171. package/src/duckdb/src/transaction/commit_state.cpp +19 -19
  172. package/src/duckdb/src/transaction/duck_transaction.cpp +7 -7
  173. package/src/duckdb/src/transaction/rollback_state.cpp +1 -1
  174. package/src/duckdb/src/transaction/undo_buffer.cpp +2 -1
  175. package/src/duckdb/ub_src_common_adbc.cpp +4 -0
  176. package/src/duckdb/src/include/duckdb/common/single_thread_ptr.hpp +0 -185
@@ -34,7 +34,7 @@ public:
34
34
  static DuckTransaction &Get(ClientContext &context, Catalog &catalog);
35
35
  LocalStorage &GetLocalStorage();
36
36
 
37
- void PushCatalogEntry(CatalogEntry *entry, data_ptr_t extra_data = nullptr, idx_t extra_data_size = 0);
37
+ void PushCatalogEntry(CatalogEntry &entry, data_ptr_t extra_data = nullptr, idx_t extra_data_size = 0);
38
38
 
39
39
  //! Commit the current transaction with the given commit identifier. Returns an error message if the transaction
40
40
  //! commit failed, or an empty string if the commit was sucessful
@@ -49,8 +49,8 @@ public:
49
49
 
50
50
  bool ChangesMade();
51
51
 
52
- void PushDelete(DataTable *table, ChunkVectorInfo *vinfo, row_t rows[], idx_t count, idx_t base_row);
53
- void PushAppend(DataTable *table, idx_t row_start, idx_t row_count);
52
+ void PushDelete(DataTable &table, ChunkVectorInfo *vinfo, row_t rows[], idx_t count, idx_t base_row);
53
+ void PushAppend(DataTable &table, idx_t row_start, idx_t row_count);
54
54
  UpdateInfo *CreateUpdateInfo(idx_t type_size, idx_t entries);
55
55
 
56
56
  bool IsDuckTransaction() const override {
@@ -22,8 +22,8 @@ struct TableAppendState;
22
22
 
23
23
  class OptimisticDataWriter {
24
24
  public:
25
- OptimisticDataWriter(DataTable *table);
26
- OptimisticDataWriter(DataTable *table, OptimisticDataWriter &parent);
25
+ OptimisticDataWriter(DataTable &table);
26
+ OptimisticDataWriter(DataTable &table, OptimisticDataWriter &parent);
27
27
  ~OptimisticDataWriter();
28
28
 
29
29
  void CheckFlushToDisk(RowGroupCollection &row_groups);
@@ -42,7 +42,7 @@ private:
42
42
 
43
43
  private:
44
44
  //! The table
45
- DataTable *table;
45
+ DataTable &table;
46
46
  //! The partial block manager (if we created one yet)
47
47
  unique_ptr<PartialBlockManager> partial_manager;
48
48
  //! The set of blocks that have been pre-emptively written to disk
@@ -60,10 +60,10 @@ public:
60
60
  LocalTableStorage(DataTable &table, LocalTableStorage &parent, idx_t drop_idx);
61
61
  // Create a LocalTableStorage from an ADD COLUMN
62
62
  LocalTableStorage(ClientContext &context, DataTable &table, LocalTableStorage &parent, ColumnDefinition &new_column,
63
- Expression *default_value);
63
+ optional_ptr<Expression> default_value);
64
64
  ~LocalTableStorage();
65
65
 
66
- DataTable *table;
66
+ reference<DataTable> table_ref;
67
67
 
68
68
  Allocator &allocator;
69
69
  //! The main chunk collection holding the data
@@ -78,7 +78,7 @@ public:
78
78
  vector<unique_ptr<OptimisticDataWriter>> optimistic_writers;
79
79
 
80
80
  public:
81
- void InitializeScan(CollectionScanState &state, TableFilterSet *table_filters = nullptr);
81
+ void InitializeScan(CollectionScanState &state, optional_ptr<TableFilterSet> table_filters = nullptr);
82
82
  //! Check if we should flush the previously written row-group to disk
83
83
  void CheckFlushToDisk();
84
84
  //! Flushes the final row group to disk (if any)
@@ -92,22 +92,22 @@ public:
92
92
  const vector<LogicalType> &table_types, row_t &start_row);
93
93
 
94
94
  //! Creates an optimistic writer for this table
95
- OptimisticDataWriter *CreateOptimisticWriter();
95
+ OptimisticDataWriter &CreateOptimisticWriter();
96
96
  };
97
97
 
98
98
  class LocalTableManager {
99
99
  public:
100
- shared_ptr<LocalTableStorage> MoveEntry(DataTable *table);
101
- unordered_map<DataTable *, shared_ptr<LocalTableStorage>> MoveEntries();
102
- LocalTableStorage *GetStorage(DataTable *table);
103
- LocalTableStorage *GetOrCreateStorage(DataTable *table);
100
+ shared_ptr<LocalTableStorage> MoveEntry(DataTable &table);
101
+ reference_map_t<DataTable, shared_ptr<LocalTableStorage>> MoveEntries();
102
+ optional_ptr<LocalTableStorage> GetStorage(DataTable &table);
103
+ LocalTableStorage &GetOrCreateStorage(DataTable &table);
104
104
  idx_t EstimatedSize();
105
105
  bool IsEmpty();
106
- void InsertEntry(DataTable *table, shared_ptr<LocalTableStorage> entry);
106
+ void InsertEntry(DataTable &table, shared_ptr<LocalTableStorage> entry);
107
107
 
108
108
  private:
109
109
  mutex table_storage_lock;
110
- unordered_map<DataTable *, shared_ptr<LocalTableStorage>> table_storage;
110
+ reference_map_t<DataTable, shared_ptr<LocalTableStorage>> table_storage;
111
111
  };
112
112
 
113
113
  //! The LocalStorage class holds appends that have not been committed yet
@@ -121,7 +121,7 @@ public:
121
121
  CommitState();
122
122
  ~CommitState();
123
123
 
124
- unordered_map<DataTable *, unique_ptr<TableAppendState>> append_states;
124
+ reference_map_t<DataTable, unique_ptr<TableAppendState>> append_states;
125
125
  };
126
126
 
127
127
  public:
@@ -132,29 +132,29 @@ public:
132
132
  static LocalStorage &Get(ClientContext &context, Catalog &catalog);
133
133
 
134
134
  //! Initialize a scan of the local storage
135
- void InitializeScan(DataTable *table, CollectionScanState &state, TableFilterSet *table_filters);
135
+ void InitializeScan(DataTable &table, CollectionScanState &state, optional_ptr<TableFilterSet> table_filters);
136
136
  //! Scan
137
137
  void Scan(CollectionScanState &state, const vector<column_t> &column_ids, DataChunk &result);
138
138
 
139
- void InitializeParallelScan(DataTable *table, ParallelCollectionScanState &state);
140
- bool NextParallelScan(ClientContext &context, DataTable *table, ParallelCollectionScanState &state,
139
+ void InitializeParallelScan(DataTable &table, ParallelCollectionScanState &state);
140
+ bool NextParallelScan(ClientContext &context, DataTable &table, ParallelCollectionScanState &state,
141
141
  CollectionScanState &scan_state);
142
142
 
143
143
  //! Begin appending to the local storage
144
- void InitializeAppend(LocalAppendState &state, DataTable *table);
144
+ void InitializeAppend(LocalAppendState &state, DataTable &table);
145
145
  //! Append a chunk to the local storage
146
146
  static void Append(LocalAppendState &state, DataChunk &chunk);
147
147
  //! Finish appending to the local storage
148
148
  static void FinalizeAppend(LocalAppendState &state);
149
149
  //! Merge a row group collection into the transaction-local storage
150
- void LocalMerge(DataTable *table, RowGroupCollection &collection);
150
+ void LocalMerge(DataTable &table, RowGroupCollection &collection);
151
151
  //! Create an optimistic writer for the specified table
152
- OptimisticDataWriter *CreateOptimisticWriter(DataTable *table);
152
+ OptimisticDataWriter &CreateOptimisticWriter(DataTable &table);
153
153
 
154
154
  //! Delete a set of rows from the local storage
155
- idx_t Delete(DataTable *table, Vector &row_ids, idx_t count);
155
+ idx_t Delete(DataTable &table, Vector &row_ids, idx_t count);
156
156
  //! Update a set of rows in the local storage
157
- void Update(DataTable *table, Vector &row_ids, const vector<PhysicalIndex> &column_ids, DataChunk &data);
157
+ void Update(DataTable &table, Vector &row_ids, const vector<PhysicalIndex> &column_ids, DataChunk &data);
158
158
 
159
159
  //! Commits the local storage, writing it to the WAL and completing the commit
160
160
  void Commit(LocalStorage::CommitState &commit_state, DuckTransaction &transaction);
@@ -164,19 +164,20 @@ public:
164
164
  bool ChangesMade() noexcept;
165
165
  idx_t EstimatedSize();
166
166
 
167
- bool Find(DataTable *table);
167
+ bool Find(DataTable &table);
168
168
 
169
- idx_t AddedRows(DataTable *table);
169
+ idx_t AddedRows(DataTable &table);
170
170
 
171
- void AddColumn(DataTable *old_dt, DataTable *new_dt, ColumnDefinition &new_column, Expression *default_value);
172
- void DropColumn(DataTable *old_dt, DataTable *new_dt, idx_t removed_column);
173
- void ChangeType(DataTable *old_dt, DataTable *new_dt, idx_t changed_idx, const LogicalType &target_type,
171
+ void AddColumn(DataTable &old_dt, DataTable &new_dt, ColumnDefinition &new_column,
172
+ optional_ptr<Expression> default_value);
173
+ void DropColumn(DataTable &old_dt, DataTable &new_dt, idx_t removed_column);
174
+ void ChangeType(DataTable &old_dt, DataTable &new_dt, idx_t changed_idx, const LogicalType &target_type,
174
175
  const vector<column_t> &bound_columns, Expression &cast_expr);
175
176
 
176
- void MoveStorage(DataTable *old_dt, DataTable *new_dt);
177
- void FetchChunk(DataTable *table, Vector &row_ids, idx_t count, const vector<column_t> &col_ids, DataChunk &chunk,
177
+ void MoveStorage(DataTable &old_dt, DataTable &new_dt);
178
+ void FetchChunk(DataTable &table, Vector &row_ids, idx_t count, const vector<column_t> &col_ids, DataChunk &chunk,
178
179
  ColumnFetchState &fetch_state);
179
- TableIndexList &GetIndexes(DataTable *table);
180
+ TableIndexList &GetIndexes(DataTable &table);
180
181
 
181
182
  void VerifyNewConstraint(DataTable &parent, const BoundConstraint &constraint);
182
183
 
@@ -9,6 +9,7 @@
9
9
  #pragma once
10
10
 
11
11
  #include "duckdb/common/common.hpp"
12
+ #include "duckdb/common/optional_ptr.hpp"
12
13
 
13
14
  namespace duckdb {
14
15
  class DuckTransaction;
@@ -18,7 +19,7 @@ struct TransactionData {
18
19
  TransactionData(DuckTransaction &transaction_p);
19
20
  TransactionData(transaction_t transaction_id_p, transaction_t start_time_p);
20
21
 
21
- DuckTransaction *transaction;
22
+ optional_ptr<DuckTransaction> transaction;
22
23
  transaction_t transaction_id;
23
24
  transaction_t start_time;
24
25
  };
@@ -40,7 +40,7 @@ public:
40
40
  //! Cleanup the undo buffer
41
41
  void Cleanup();
42
42
  //! Commit the changes made in the UndoBuffer: should be called on commit
43
- void Commit(UndoBuffer::IteratorState &iterator_state, WriteAheadLog *log, transaction_t commit_id);
43
+ void Commit(UndoBuffer::IteratorState &iterator_state, optional_ptr<WriteAheadLog> log, transaction_t commit_id);
44
44
  //! Revert committed changes made in the UndoBuffer up until the currently committed state
45
45
  void RevertCommit(UndoBuffer::IteratorState &iterator_state, transaction_t transaction_id);
46
46
  //! Rollback the changes made in this UndoBuffer: should be called on
@@ -419,7 +419,7 @@ unique_ptr<PendingQueryResult> ClientContext::PendingPreparedStatement(ClientCon
419
419
  D_ASSERT(collector->type == PhysicalOperatorType::RESULT_COLLECTOR);
420
420
  executor.Initialize(std::move(collector));
421
421
  } else {
422
- executor.Initialize(statement.plan.get());
422
+ executor.Initialize(*statement.plan);
423
423
  }
424
424
  auto types = executor.GetTypes();
425
425
  D_ASSERT(types == statement.types);
@@ -208,7 +208,7 @@ void QueryProfiler::EndPhase() {
208
208
  }
209
209
  }
210
210
 
211
- void QueryProfiler::Initialize(PhysicalOperator *root_op) {
211
+ void QueryProfiler::Initialize(const PhysicalOperator &root_op) {
212
212
  if (!IsEnabled() || !running) {
213
213
  return;
214
214
  }
@@ -227,7 +227,7 @@ void QueryProfiler::Initialize(PhysicalOperator *root_op) {
227
227
  OperatorProfiler::OperatorProfiler(bool enabled_p) : enabled(enabled_p), active_operator(nullptr) {
228
228
  }
229
229
 
230
- void OperatorProfiler::StartOperator(const PhysicalOperator *phys_op) {
230
+ void OperatorProfiler::StartOperator(optional_ptr<const PhysicalOperator> phys_op) {
231
231
  if (!enabled) {
232
232
  return;
233
233
  }
@@ -242,7 +242,7 @@ void OperatorProfiler::StartOperator(const PhysicalOperator *phys_op) {
242
242
  op.Start();
243
243
  }
244
244
 
245
- void OperatorProfiler::EndOperator(DataChunk *chunk) {
245
+ void OperatorProfiler::EndOperator(optional_ptr<DataChunk> chunk) {
246
246
  if (!enabled) {
247
247
  return;
248
248
  }
@@ -254,11 +254,11 @@ void OperatorProfiler::EndOperator(DataChunk *chunk) {
254
254
  // finish timing for the current element
255
255
  op.End();
256
256
 
257
- AddTiming(active_operator, op.Elapsed(), chunk ? chunk->size() : 0);
257
+ AddTiming(*active_operator, op.Elapsed(), chunk ? chunk->size() : 0);
258
258
  active_operator = nullptr;
259
259
  }
260
260
 
261
- void OperatorProfiler::AddTiming(const PhysicalOperator *op, double time, idx_t elements) {
261
+ void OperatorProfiler::AddTiming(const PhysicalOperator &op, double time, idx_t elements) {
262
262
  if (!enabled) {
263
263
  return;
264
264
  }
@@ -275,7 +275,7 @@ void OperatorProfiler::AddTiming(const PhysicalOperator *op, double time, idx_t
275
275
  entry->second.elements += elements;
276
276
  }
277
277
  }
278
- void OperatorProfiler::Flush(const PhysicalOperator *phys_op, ExpressionExecutor *expression_executor,
278
+ void OperatorProfiler::Flush(const PhysicalOperator &phys_op, ExpressionExecutor &expression_executor,
279
279
  const string &name, int id) {
280
280
  auto entry = timings.find(phys_op);
281
281
  if (entry == timings.end()) {
@@ -285,8 +285,8 @@ void OperatorProfiler::Flush(const PhysicalOperator *phys_op, ExpressionExecutor
285
285
  if (int(operator_timing.executors_info.size()) <= id) {
286
286
  operator_timing.executors_info.resize(id + 1);
287
287
  }
288
- operator_timing.executors_info[id] = make_uniq<ExpressionExecutorInfo>(*expression_executor, name, id);
289
- operator_timing.name = phys_op->GetName();
288
+ operator_timing.executors_info[id] = make_uniq<ExpressionExecutorInfo>(expression_executor, name, id);
289
+ operator_timing.name = phys_op.GetName();
290
290
  }
291
291
 
292
292
  void QueryProfiler::Flush(OperatorProfiler &profiler) {
@@ -295,11 +295,13 @@ void QueryProfiler::Flush(OperatorProfiler &profiler) {
295
295
  return;
296
296
  }
297
297
  for (auto &node : profiler.timings) {
298
- auto entry = tree_map.find(node.first);
298
+ auto &op = node.first.get();
299
+ auto entry = tree_map.find(op);
299
300
  D_ASSERT(entry != tree_map.end());
301
+ auto &tree_node = entry->second.get();
300
302
 
301
- entry->second->info.time += node.second.time;
302
- entry->second->info.elements += node.second.elements;
303
+ tree_node.info.time += node.second.time;
304
+ tree_node.info.elements += node.second.elements;
303
305
  if (!IsDetailedEnabled()) {
304
306
  continue;
305
307
  }
@@ -308,10 +310,10 @@ void QueryProfiler::Flush(OperatorProfiler &profiler) {
308
310
  continue;
309
311
  }
310
312
  auto info_id = info->id;
311
- if (int(entry->second->info.executors_info.size()) <= info_id) {
312
- entry->second->info.executors_info.resize(info_id + 1);
313
+ if (int32_t(tree_node.info.executors_info.size()) <= info_id) {
314
+ tree_node.info.executors_info.resize(info_id + 1);
313
315
  }
314
- entry->second->info.executors_info[info_id] = std::move(info);
316
+ tree_node.info.executors_info[info_id] = std::move(info);
315
317
  }
316
318
  }
317
319
  profiler.timings.clear();
@@ -610,19 +612,19 @@ void QueryProfiler::WriteToFile(const char *path, string &info) const {
610
612
  }
611
613
  }
612
614
 
613
- unique_ptr<QueryProfiler::TreeNode> QueryProfiler::CreateTree(PhysicalOperator *root, idx_t depth) {
614
- if (OperatorRequiresProfiling(root->type)) {
615
+ unique_ptr<QueryProfiler::TreeNode> QueryProfiler::CreateTree(const PhysicalOperator &root, idx_t depth) {
616
+ if (OperatorRequiresProfiling(root.type)) {
615
617
  this->query_requires_profiling = true;
616
618
  }
617
619
  auto node = make_uniq<QueryProfiler::TreeNode>();
618
- node->type = root->type;
619
- node->name = root->GetName();
620
- node->extra_info = root->ParamsToString();
620
+ node->type = root.type;
621
+ node->name = root.GetName();
622
+ node->extra_info = root.ParamsToString();
621
623
  node->depth = depth;
622
- tree_map[root] = node.get();
623
- auto children = root->GetChildren();
624
+ tree_map.insert(make_pair(reference<const PhysicalOperator>(root), reference<QueryProfiler::TreeNode>(*node)));
625
+ auto children = root.GetChildren();
624
626
  for (auto &child : children) {
625
- auto child_node = CreateTree(child, depth + 1);
627
+ auto child_node = CreateTree(child.get(), depth + 1);
626
628
  node->children.push_back(std::move(child_node));
627
629
  }
628
630
  return node;
@@ -38,13 +38,19 @@ void Executor::AddEvent(shared_ptr<Event> event) {
38
38
  }
39
39
 
40
40
  struct PipelineEventStack {
41
- Event *pipeline_initialize_event;
42
- Event *pipeline_event;
43
- Event *pipeline_finish_event;
44
- Event *pipeline_complete_event;
41
+ PipelineEventStack(Event &pipeline_initialize_event, Event &pipeline_event, Event &pipeline_finish_event,
42
+ Event &pipeline_complete_event)
43
+ : pipeline_initialize_event(pipeline_initialize_event), pipeline_event(pipeline_event),
44
+ pipeline_finish_event(pipeline_finish_event), pipeline_complete_event(pipeline_complete_event) {
45
+ }
46
+
47
+ Event &pipeline_initialize_event;
48
+ Event &pipeline_event;
49
+ Event &pipeline_finish_event;
50
+ Event &pipeline_complete_event;
45
51
  };
46
52
 
47
- using event_map_t = unordered_map<const Pipeline *, PipelineEventStack>;
53
+ using event_map_t = reference_map_t<Pipeline, PipelineEventStack>;
48
54
 
49
55
  struct ScheduleEventData {
50
56
  ScheduleEventData(const vector<shared_ptr<MetaPipeline>> &meta_pipelines, vector<shared_ptr<Event>> &events,
@@ -69,17 +75,16 @@ void Executor::SchedulePipeline(const shared_ptr<MetaPipeline> &meta_pipeline, S
69
75
  auto base_event = make_shared<PipelineEvent>(base_pipeline);
70
76
  auto base_finish_event = make_shared<PipelineFinishEvent>(base_pipeline);
71
77
  auto base_complete_event = make_shared<PipelineCompleteEvent>(base_pipeline->executor, event_data.initial_schedule);
72
- PipelineEventStack base_stack {base_initialize_event.get(), base_event.get(), base_finish_event.get(),
73
- base_complete_event.get()};
78
+ PipelineEventStack base_stack(*base_initialize_event, *base_event, *base_finish_event, *base_complete_event);
74
79
  events.push_back(std::move(base_initialize_event));
75
80
  events.push_back(std::move(base_event));
76
81
  events.push_back(std::move(base_finish_event));
77
82
  events.push_back(std::move(base_complete_event));
78
83
 
79
84
  // dependencies: initialize -> event -> finish -> complete
80
- base_stack.pipeline_event->AddDependency(*base_stack.pipeline_initialize_event);
81
- base_stack.pipeline_finish_event->AddDependency(*base_stack.pipeline_event);
82
- base_stack.pipeline_complete_event->AddDependency(*base_stack.pipeline_finish_event);
85
+ base_stack.pipeline_event.AddDependency(base_stack.pipeline_initialize_event);
86
+ base_stack.pipeline_finish_event.AddDependency(base_stack.pipeline_event);
87
+ base_stack.pipeline_complete_event.AddDependency(base_stack.pipeline_finish_event);
83
88
 
84
89
  // create an event and stack for all pipelines in the MetaPipeline
85
90
  vector<shared_ptr<Pipeline>> pipelines;
@@ -90,30 +95,30 @@ void Executor::SchedulePipeline(const shared_ptr<MetaPipeline> &meta_pipeline, S
90
95
 
91
96
  // create events/stack for this pipeline
92
97
  auto pipeline_event = make_shared<PipelineEvent>(pipeline);
93
- Event *pipeline_finish_event_ptr;
98
+ optional_ptr<Event> pipeline_finish_event_ptr;
94
99
  if (meta_pipeline->HasFinishEvent(pipeline.get())) {
95
100
  // this pipeline has its own finish event (despite going into the same sink - Finalize twice!)
96
101
  auto pipeline_finish_event = make_shared<PipelineFinishEvent>(pipeline);
97
102
  pipeline_finish_event_ptr = pipeline_finish_event.get();
98
103
  events.push_back(std::move(pipeline_finish_event));
99
- base_stack.pipeline_complete_event->AddDependency(*pipeline_finish_event_ptr);
104
+ base_stack.pipeline_complete_event.AddDependency(*pipeline_finish_event_ptr);
100
105
  } else {
101
- pipeline_finish_event_ptr = base_stack.pipeline_finish_event;
106
+ pipeline_finish_event_ptr = &base_stack.pipeline_finish_event;
102
107
  }
103
- PipelineEventStack pipeline_stack {base_stack.pipeline_initialize_event, pipeline_event.get(),
104
- pipeline_finish_event_ptr, base_stack.pipeline_complete_event};
108
+ PipelineEventStack pipeline_stack(base_stack.pipeline_initialize_event, *pipeline_event,
109
+ *pipeline_finish_event_ptr, base_stack.pipeline_complete_event);
105
110
  events.push_back(std::move(pipeline_event));
106
111
 
107
112
  // dependencies: base_initialize -> pipeline_event -> base_finish
108
- pipeline_stack.pipeline_event->AddDependency(*base_stack.pipeline_initialize_event);
109
- pipeline_stack.pipeline_finish_event->AddDependency(*pipeline_stack.pipeline_event);
113
+ pipeline_stack.pipeline_event.AddDependency(base_stack.pipeline_initialize_event);
114
+ pipeline_stack.pipeline_finish_event.AddDependency(pipeline_stack.pipeline_event);
110
115
 
111
116
  // add pipeline stack to event map
112
- event_map.insert(make_pair(pipeline.get(), pipeline_stack));
117
+ event_map.insert(make_pair(reference<Pipeline>(*pipeline), pipeline_stack));
113
118
  }
114
119
 
115
120
  // add base stack to the event data too
116
- event_map.insert(make_pair(base_pipeline.get(), base_stack));
121
+ event_map.insert(make_pair(reference<Pipeline>(*base_pipeline), base_stack));
117
122
 
118
123
  // set up the dependencies within this MetaPipeline
119
124
  for (auto &pipeline : pipelines) {
@@ -128,10 +133,14 @@ void Executor::SchedulePipeline(const shared_ptr<MetaPipeline> &meta_pipeline, S
128
133
  if (!dependencies) {
129
134
  continue;
130
135
  }
131
- auto &pipeline_stack = event_map[pipeline.get()];
136
+ auto root_entry = event_map.find(*pipeline);
137
+ D_ASSERT(root_entry != event_map.end());
138
+ auto &pipeline_stack = root_entry->second;
132
139
  for (auto &dependency : *dependencies) {
133
- auto &dependency_stack = event_map[dependency];
134
- pipeline_stack.pipeline_event->AddDependency(*dependency_stack.pipeline_event);
140
+ auto event_entry = event_map.find(*dependency);
141
+ D_ASSERT(event_entry != event_map.end());
142
+ auto &dependency_stack = event_entry->second;
143
+ pipeline_stack.pipeline_event.AddDependency(dependency_stack.pipeline_event);
135
144
  }
136
145
  }
137
146
  }
@@ -148,15 +157,14 @@ void Executor::ScheduleEventsInternal(ScheduleEventData &event_data) {
148
157
  // set up the dependencies across MetaPipelines
149
158
  auto &event_map = event_data.event_map;
150
159
  for (auto &entry : event_map) {
151
- auto pipeline = entry.first;
152
- for (auto &dependency : pipeline->dependencies) {
160
+ auto &pipeline = entry.first.get();
161
+ for (auto &dependency : pipeline.dependencies) {
153
162
  auto dep = dependency.lock();
154
163
  D_ASSERT(dep);
155
- auto event_map_entry = event_map.find(dep.get());
164
+ auto event_map_entry = event_map.find(*dep);
156
165
  D_ASSERT(event_map_entry != event_map.end());
157
166
  auto &dep_entry = event_map_entry->second;
158
- D_ASSERT(dep_entry.pipeline_complete_event);
159
- entry.second.pipeline_event->AddDependency(*dep_entry.pipeline_complete_event);
167
+ entry.second.pipeline_event.AddDependency(dep_entry.pipeline_complete_event);
160
168
  }
161
169
  }
162
170
 
@@ -231,7 +239,7 @@ void Executor::VerifyScheduledEventsInternal(const idx_t vertex, const vector<Ev
231
239
  recursion_stack[vertex] = false;
232
240
  }
233
241
 
234
- void Executor::AddRecursiveCTE(PhysicalOperator *rec_cte) {
242
+ void Executor::AddRecursiveCTE(PhysicalOperator &rec_cte) {
235
243
  recursive_ctes.push_back(rec_cte);
236
244
  }
237
245
 
@@ -258,8 +266,8 @@ void Executor::VerifyPipeline(Pipeline &pipeline) {
258
266
  auto other_operators = other_pipeline->GetOperators();
259
267
  for (idx_t op_idx = 0; op_idx < operators.size(); op_idx++) {
260
268
  for (idx_t other_idx = 0; other_idx < other_operators.size(); other_idx++) {
261
- auto &left = *operators[op_idx];
262
- auto &right = *other_operators[other_idx];
269
+ auto &left = operators[op_idx].get();
270
+ auto &right = other_operators[other_idx].get();
263
271
  if (left.Equals(right)) {
264
272
  D_ASSERT(right.Equals(left));
265
273
  } else {
@@ -281,23 +289,23 @@ void Executor::VerifyPipelines() {
281
289
  void Executor::Initialize(unique_ptr<PhysicalOperator> physical_plan) {
282
290
  Reset();
283
291
  owned_plan = std::move(physical_plan);
284
- InitializeInternal(owned_plan.get());
292
+ InitializeInternal(*owned_plan);
285
293
  }
286
294
 
287
- void Executor::Initialize(PhysicalOperator *plan) {
295
+ void Executor::Initialize(PhysicalOperator &plan) {
288
296
  Reset();
289
297
  InitializeInternal(plan);
290
298
  }
291
299
 
292
- void Executor::InitializeInternal(PhysicalOperator *plan) {
300
+ void Executor::InitializeInternal(PhysicalOperator &plan) {
293
301
 
294
302
  auto &scheduler = TaskScheduler::GetScheduler(context);
295
303
  {
296
304
  lock_guard<mutex> elock(executor_lock);
297
- physical_plan = plan;
305
+ physical_plan = &plan;
298
306
 
299
307
  this->profiler = ClientData::Get(context).profiler;
300
- profiler->Initialize(physical_plan);
308
+ profiler->Initialize(plan);
301
309
  this->producer = scheduler.CreateProducer();
302
310
 
303
311
  // build and ready the pipelines
@@ -307,10 +315,9 @@ void Executor::InitializeInternal(PhysicalOperator *plan) {
307
315
  root_pipeline->Ready();
308
316
 
309
317
  // ready recursive cte pipelines too
310
- for (auto &rec_cte : recursive_ctes) {
311
- D_ASSERT(rec_cte->type == PhysicalOperatorType::RECURSIVE_CTE);
312
- auto &rec_cte_op = (PhysicalRecursiveCTE &)*rec_cte;
313
- rec_cte_op.recursive_meta_pipeline->Ready();
318
+ for (auto &rec_cte_ref : recursive_ctes) {
319
+ auto &rec_cte = rec_cte_ref.get().Cast<PhysicalRecursiveCTE>();
320
+ rec_cte.recursive_meta_pipeline->Ready();
314
321
  }
315
322
 
316
323
  // set root pipelines, i.e., all pipelines that end in the final sink
@@ -346,9 +353,8 @@ void Executor::CancelTasks() {
346
353
  for (auto &pipeline : pipelines) {
347
354
  weak_references.push_back(weak_ptr<Pipeline>(pipeline));
348
355
  }
349
- for (auto op : recursive_ctes) {
350
- D_ASSERT(op->type == PhysicalOperatorType::RECURSIVE_CTE);
351
- auto &rec_cte = (PhysicalRecursiveCTE &)*op;
356
+ for (auto &rec_cte_ref : recursive_ctes) {
357
+ auto &rec_cte = rec_cte_ref.get().Cast<PhysicalRecursiveCTE>();
352
358
  rec_cte.recursive_meta_pipeline.reset();
353
359
  }
354
360
  pipelines.clear();
@@ -441,18 +447,18 @@ void Executor::Reset() {
441
447
  execution_result = PendingExecutionResult::RESULT_NOT_READY;
442
448
  }
443
449
 
444
- shared_ptr<Pipeline> Executor::CreateChildPipeline(Pipeline *current, PhysicalOperator *op) {
445
- D_ASSERT(!current->operators.empty());
446
- D_ASSERT(op->IsSource());
450
+ shared_ptr<Pipeline> Executor::CreateChildPipeline(Pipeline &current, PhysicalOperator &op) {
451
+ D_ASSERT(!current.operators.empty());
452
+ D_ASSERT(op.IsSource());
447
453
  // found another operator that is a source, schedule a child pipeline
448
454
  // 'op' is the source, and the sink is the same
449
455
  auto child_pipeline = make_shared<Pipeline>(*this);
450
- child_pipeline->sink = current->sink;
451
- child_pipeline->source = op;
456
+ child_pipeline->sink = current.sink;
457
+ child_pipeline->source = &op;
452
458
 
453
459
  // the child pipeline has the same operators up until 'op'
454
- for (auto current_op : current->operators) {
455
- if (current_op == op) {
460
+ for (auto current_op : current.operators) {
461
+ if (&current_op.get() == &op) {
456
462
  break;
457
463
  }
458
464
  child_pipeline->operators.push_back(current_op);
@@ -18,7 +18,7 @@ PipelineBuildState &MetaPipeline::GetState() const {
18
18
  return state;
19
19
  }
20
20
 
21
- PhysicalOperator *MetaPipeline::GetSink() const {
21
+ optional_ptr<PhysicalOperator> MetaPipeline::GetSink() const {
22
22
  return sink;
23
23
  }
24
24
 
@@ -83,14 +83,14 @@ void MetaPipeline::Ready() {
83
83
  }
84
84
  }
85
85
 
86
- MetaPipeline *MetaPipeline::CreateChildMetaPipeline(Pipeline &current, PhysicalOperator *op) {
87
- children.push_back(make_shared<MetaPipeline>(executor, state, op));
86
+ MetaPipeline &MetaPipeline::CreateChildMetaPipeline(Pipeline &current, PhysicalOperator &op) {
87
+ children.push_back(make_shared<MetaPipeline>(executor, state, &op));
88
88
  auto child_meta_pipeline = children.back().get();
89
89
  // child MetaPipeline must finish completely before this MetaPipeline can start
90
90
  current.AddDependency(child_meta_pipeline->GetBasePipeline());
91
91
  // child meta pipeline is part of the recursive CTE too
92
92
  child_meta_pipeline->recursive_cte = recursive_cte;
93
- return child_meta_pipeline;
93
+ return *child_meta_pipeline;
94
94
  }
95
95
 
96
96
  Pipeline *MetaPipeline::CreatePipeline() {
@@ -153,7 +153,7 @@ Pipeline *MetaPipeline::CreateUnionPipeline(Pipeline &current, bool order_matter
153
153
  return union_pipeline;
154
154
  }
155
155
 
156
- void MetaPipeline::CreateChildPipeline(Pipeline &current, PhysicalOperator *op, Pipeline *last_pipeline) {
156
+ void MetaPipeline::CreateChildPipeline(Pipeline &current, PhysicalOperator &op, Pipeline *last_pipeline) {
157
157
  // rule 2: 'current' must be fully built (down to the source) before creating the child pipeline
158
158
  D_ASSERT(current.source);
159
159