duckdb 0.7.2-dev1637.0 → 0.7.2-dev1684.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 (71) hide show
  1. package/package.json +1 -1
  2. package/src/duckdb/src/execution/expression_executor.cpp +1 -1
  3. package/src/duckdb/src/execution/expression_executor_state.cpp +2 -3
  4. package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +1 -1
  5. package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +10 -0
  6. package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +0 -5
  7. package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +4 -0
  8. package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +0 -5
  9. package/src/duckdb/src/execution/operator/helper/physical_streaming_limit.cpp +2 -2
  10. package/src/duckdb/src/execution/operator/set/physical_union.cpp +13 -2
  11. package/src/duckdb/src/execution/physical_operator.cpp +0 -15
  12. package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +24 -4
  13. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  14. package/src/duckdb/src/include/duckdb/common/enums/order_preservation_type.hpp +24 -0
  15. package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +1 -3
  16. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +9 -2
  17. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +8 -1
  18. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +2 -2
  19. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +6 -0
  20. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +6 -3
  21. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +0 -1
  22. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +4 -0
  23. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +5 -1
  24. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +5 -1
  25. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +4 -0
  26. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +1 -0
  27. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +4 -0
  28. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +4 -0
  29. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +4 -0
  30. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reset.hpp +4 -0
  31. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +4 -1
  32. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +4 -0
  33. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_limit.hpp +1 -1
  34. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_transaction.hpp +4 -0
  35. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +4 -0
  36. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +6 -5
  37. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +4 -1
  38. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_index_join.hpp +3 -4
  39. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +7 -1
  40. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +8 -1
  41. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +7 -0
  42. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +4 -0
  43. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +5 -1
  44. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +4 -0
  45. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +4 -0
  46. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +8 -0
  47. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +4 -0
  48. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +4 -0
  49. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +4 -0
  50. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +4 -0
  51. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_positional_scan.hpp +4 -0
  52. package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +3 -0
  53. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +4 -0
  54. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +4 -0
  55. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +4 -0
  56. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +4 -0
  57. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +4 -0
  58. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +4 -0
  59. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_table.hpp +4 -0
  60. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +4 -0
  61. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +4 -0
  62. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +4 -0
  63. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +4 -0
  64. package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +4 -0
  65. package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +15 -9
  66. package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +1 -1
  67. package/src/duckdb/src/include/duckdb/planner/pragma_handler.hpp +3 -2
  68. package/src/duckdb/src/main/extension/extension_helper.cpp +17 -2
  69. package/src/duckdb/src/main/query_profiler.cpp +1 -1
  70. package/src/duckdb/src/parallel/pipeline.cpp +24 -9
  71. package/src/duckdb/src/planner/pragma_handler.cpp +7 -5
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.7.2-dev1637.0",
5
+ "version": "0.7.2-dev1684.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -56,7 +56,7 @@ Allocator &ExpressionExecutor::GetAllocator() {
56
56
 
57
57
  void ExpressionExecutor::AddExpression(const Expression &expr) {
58
58
  expressions.push_back(&expr);
59
- auto state = make_uniq<ExpressionExecutorState>(expr.ToString());
59
+ auto state = make_uniq<ExpressionExecutorState>();
60
60
  Initialize(expr, *state);
61
61
  state->Verify();
62
62
  states.push_back(std::move(state));
@@ -31,11 +31,10 @@ ClientContext &ExpressionState::GetContext() {
31
31
  return root.executor->GetContext();
32
32
  }
33
33
 
34
- ExpressionState::ExpressionState(const Expression &expr, ExpressionExecutorState &root)
35
- : expr(expr), root(root), name(expr.ToString()) {
34
+ ExpressionState::ExpressionState(const Expression &expr, ExpressionExecutorState &root) : expr(expr), root(root) {
36
35
  }
37
36
 
38
- ExpressionExecutorState::ExpressionExecutorState(const string &name) : profiler(), name(name) {
37
+ ExpressionExecutorState::ExpressionExecutorState() : profiler() {
39
38
  }
40
39
 
41
40
  void ExpressionState::Verify(ExpressionExecutorState &root_executor) {
@@ -843,7 +843,7 @@ public:
843
843
  auto &grouping_gstate = ht_state.grouping_states[sidx];
844
844
  count += grouping.table_data.Size(*grouping_gstate.table_state);
845
845
  }
846
- return MaxValue<idx_t>(1, count / RowGroup::ROW_GROUP_SIZE);
846
+ return MaxValue<idx_t>(1, count / STANDARD_VECTOR_SIZE);
847
847
  }
848
848
  };
849
849
 
@@ -166,6 +166,16 @@ public:
166
166
  }
167
167
  };
168
168
 
169
+ bool PhysicalUngroupedAggregate::SinkOrderDependent() const {
170
+ for (auto &expr : aggregates) {
171
+ auto &aggr = expr->Cast<BoundAggregateExpression>();
172
+ if (aggr.function.order_dependent == AggregateOrderDependent::ORDER_DEPENDENT) {
173
+ return true;
174
+ }
175
+ }
176
+ return false;
177
+ }
178
+
169
179
  unique_ptr<GlobalSinkState> PhysicalUngroupedAggregate::GetGlobalSinkState(ClientContext &context) const {
170
180
  return make_uniq<UngroupedAggregateGlobalState>(*this, context);
171
181
  }
@@ -12,11 +12,6 @@ vector<PhysicalOperator *> PhysicalExecute::GetChildren() const {
12
12
  return {plan};
13
13
  }
14
14
 
15
- bool PhysicalExecute::AllOperatorsPreserveOrder() const {
16
- D_ASSERT(plan);
17
- return plan->AllOperatorsPreserveOrder();
18
- }
19
-
20
15
  void PhysicalExecute::BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) {
21
16
  // EXECUTE statement: build pipeline on child
22
17
  meta_pipeline.Build(plan);
@@ -75,4 +75,8 @@ bool PhysicalMaterializedCollector::ParallelSink() const {
75
75
  return parallel;
76
76
  }
77
77
 
78
+ bool PhysicalMaterializedCollector::SinkOrderDependent() const {
79
+ return true;
80
+ }
81
+
78
82
  } // namespace duckdb
@@ -35,11 +35,6 @@ vector<PhysicalOperator *> PhysicalResultCollector::GetChildren() const {
35
35
  return {plan};
36
36
  }
37
37
 
38
- bool PhysicalResultCollector::AllOperatorsPreserveOrder() const {
39
- D_ASSERT(plan);
40
- return plan->AllOperatorsPreserveOrder();
41
- }
42
-
43
38
  void PhysicalResultCollector::BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) {
44
39
  // operator is a sink, build a pipeline
45
40
  sink_state.reset();
@@ -60,8 +60,8 @@ OperatorResultType PhysicalStreamingLimit::Execute(ExecutionContext &context, Da
60
60
  return OperatorResultType::NEED_MORE_INPUT;
61
61
  }
62
62
 
63
- bool PhysicalStreamingLimit::IsOrderDependent() const {
64
- return !parallel;
63
+ OrderPreservationType PhysicalStreamingLimit::OperatorOrder() const {
64
+ return OrderPreservationType::FIXED_ORDER;
65
65
  }
66
66
 
67
67
  bool PhysicalStreamingLimit::ParallelOperator() const {
@@ -22,8 +22,19 @@ void PhysicalUnion::BuildPipelines(Pipeline &current, MetaPipeline &meta_pipelin
22
22
 
23
23
  // order matters if any of the downstream operators are order dependent,
24
24
  // or if the sink preserves order, but does not support batch indices to do so
25
- auto snk = meta_pipeline.GetSink();
26
- bool order_matters = current.IsOrderDependent() || (snk && snk->IsOrderPreserving() && !snk->RequiresBatchIndex());
25
+ auto sink = meta_pipeline.GetSink();
26
+ bool order_matters = false;
27
+ if (current.IsOrderDependent()) {
28
+ order_matters = true;
29
+ }
30
+ if (sink) {
31
+ if (sink->SinkOrderDependent() && !sink->RequiresBatchIndex()) {
32
+ order_matters = true;
33
+ }
34
+ if (!sink->ParallelSink()) {
35
+ order_matters = true;
36
+ }
37
+ }
27
38
 
28
39
  // create a union pipeline that is identical to 'current'
29
40
  auto union_pipeline = meta_pipeline.CreateUnionPipeline(current, order_matters);
@@ -184,21 +184,6 @@ bool PhysicalOperator::AllSourcesSupportBatchIndex() const {
184
184
  return true;
185
185
  }
186
186
 
187
- bool PhysicalOperator::AllOperatorsPreserveOrder() const {
188
- if (type == PhysicalOperatorType::ORDER_BY) {
189
- return true;
190
- }
191
- if (!IsOrderPreserving()) {
192
- return false;
193
- }
194
- for (auto &child : children) {
195
- if (!child->AllOperatorsPreserveOrder()) {
196
- return false;
197
- }
198
- }
199
- return true;
200
- }
201
-
202
187
  void PhysicalOperator::Verify() {
203
188
  #ifdef DEBUG
204
189
  auto sources = GetSources();
@@ -10,14 +10,34 @@
10
10
 
11
11
  namespace duckdb {
12
12
 
13
+ static OrderPreservationType OrderPreservationRecursive(PhysicalOperator &op) {
14
+ if (op.IsSource()) {
15
+ return op.SourceOrder();
16
+ }
17
+ for (auto &child : op.children) {
18
+ auto child_preservation = OrderPreservationRecursive(*child);
19
+ if (child_preservation != OrderPreservationType::INSERTION_ORDER) {
20
+ return child_preservation;
21
+ }
22
+ }
23
+ return OrderPreservationType::INSERTION_ORDER;
24
+ }
25
+
13
26
  bool PhysicalPlanGenerator::PreserveInsertionOrder(ClientContext &context, PhysicalOperator &plan) {
14
27
  auto &config = DBConfig::GetConfig(context);
15
- if (!config.options.preserve_insertion_order) {
16
- // preserving insertion order is disabled by config
28
+
29
+ auto preservation_type = OrderPreservationRecursive(plan);
30
+ if (preservation_type == OrderPreservationType::FIXED_ORDER) {
31
+ // always need to maintain preservation order
32
+ return true;
33
+ }
34
+ if (preservation_type == OrderPreservationType::NO_ORDER) {
35
+ // never need to preserve order
17
36
  return false;
18
37
  }
19
- if (!plan.AllOperatorsPreserveOrder()) {
20
- // the plan has no order defined: no need to preserve insertion order
38
+ // preserve insertion order - check flags
39
+ if (!config.options.preserve_insertion_order) {
40
+ // preserving insertion order is disabled by config
21
41
  return false;
22
42
  }
23
43
  return true;
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.7.2-dev1637"
2
+ #define DUCKDB_VERSION "0.7.2-dev1684"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "bacede9532"
5
+ #define DUCKDB_SOURCE_ID "754ff32005"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -0,0 +1,24 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // src/include/duckdb/common/enums/order_preservation_type.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #pragma once
10
+
11
+ #include "duckdb/common/constants.hpp"
12
+
13
+ namespace duckdb {
14
+
15
+ //===--------------------------------------------------------------------===//
16
+ // Order Preservation Type
17
+ //===--------------------------------------------------------------------===//
18
+ enum class OrderPreservationType : uint8_t {
19
+ NO_ORDER, // the operator makes no guarantees on order preservation (i.e. it might re-order the entire input)
20
+ INSERTION_ORDER, // the operator maintains the order of the child operators
21
+ FIXED_ORDER // the operator outputs rows in a fixed order that must be maintained (e.g. ORDER BY)
22
+ };
23
+
24
+ } // namespace duckdb
@@ -29,7 +29,6 @@ struct ExpressionState {
29
29
  vector<unique_ptr<ExpressionState>> child_states;
30
30
  vector<LogicalType> types;
31
31
  DataChunk intermediate_chunk;
32
- string name;
33
32
  CycleCounter profiler;
34
33
 
35
34
  public:
@@ -55,12 +54,11 @@ public:
55
54
  };
56
55
 
57
56
  struct ExpressionExecutorState {
58
- explicit ExpressionExecutorState(const string &name);
57
+ ExpressionExecutorState();
59
58
 
60
59
  unique_ptr<ExpressionState> root_state;
61
60
  ExpressionExecutor *executor = nullptr;
62
61
  CycleCounter profiler;
63
- string name;
64
62
 
65
63
  void Verify();
66
64
  };
@@ -93,12 +93,15 @@ public:
93
93
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
94
94
  LocalSourceState &lstate) const override;
95
95
 
96
+ bool IsSource() const override {
97
+ return true;
98
+ }
96
99
  bool ParallelSource() const override {
97
100
  return true;
98
101
  }
99
102
 
100
- bool IsOrderPreserving() const override {
101
- return false;
103
+ OrderPreservationType SourceOrder() const override {
104
+ return OrderPreservationType::NO_ORDER;
102
105
  }
103
106
 
104
107
  public:
@@ -122,6 +125,10 @@ public:
122
125
  return true;
123
126
  }
124
127
 
128
+ bool SinkOrderDependent() const override {
129
+ return false;
130
+ }
131
+
125
132
  public:
126
133
  string ParamsToString() const override;
127
134
  //! Toggle multi-scan capability on a hash table, which prevents the scan of the aggregate from being destructive
@@ -37,6 +37,13 @@ public:
37
37
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
38
38
  LocalSourceState &lstate) const override;
39
39
 
40
+ bool IsSource() const override {
41
+ return true;
42
+ }
43
+ OrderPreservationType SourceOrder() const override {
44
+ return OrderPreservationType::NO_ORDER;
45
+ }
46
+
40
47
  public:
41
48
  // Sink interface
42
49
  SinkResultType Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
@@ -59,7 +66,7 @@ public:
59
66
  return true;
60
67
  }
61
68
 
62
- bool IsOrderPreserving() const override {
69
+ bool SinkOrderDependent() const override {
63
70
  return false;
64
71
  }
65
72
 
@@ -33,8 +33,8 @@ public:
33
33
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
34
34
  GlobalOperatorState &gstate, OperatorState &state) const override;
35
35
 
36
- bool IsOrderDependent() const override {
37
- return true;
36
+ OrderPreservationType OperatorOrder() const override {
37
+ return OrderPreservationType::FIXED_ORDER;
38
38
  }
39
39
 
40
40
  string ParamsToString() const override;
@@ -39,6 +39,10 @@ public:
39
39
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
40
40
  LocalSourceState &lstate) const override;
41
41
 
42
+ bool IsSource() const override {
43
+ return true;
44
+ }
45
+
42
46
  public:
43
47
  // Sink interface
44
48
  SinkResultType Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
@@ -60,6 +64,8 @@ public:
60
64
  return true;
61
65
  }
62
66
 
67
+ bool SinkOrderDependent() const override;
68
+
63
69
  private:
64
70
  //! Finalize the distinct aggregates
65
71
  SinkFinalizeType FinalizeDistinct(Pipeline &pipeline, Event &event, ClientContext &context,
@@ -38,12 +38,15 @@ public:
38
38
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
39
39
  LocalSourceState &lstate) const override;
40
40
 
41
+ bool IsSource() const override {
42
+ return true;
43
+ }
41
44
  bool ParallelSource() const override {
42
45
  return true;
43
46
  }
44
47
 
45
- bool IsOrderPreserving() const override {
46
- return true;
48
+ OrderPreservationType SourceOrder() const override {
49
+ return OrderPreservationType::NO_ORDER;
47
50
  }
48
51
 
49
52
  public:
@@ -65,7 +68,7 @@ public:
65
68
  return !is_order_dependent;
66
69
  }
67
70
 
68
- bool IsOrderDependent() const override {
71
+ bool SinkOrderDependent() const override {
69
72
  return is_order_dependent;
70
73
  }
71
74
 
@@ -28,7 +28,6 @@ public:
28
28
  vector<PhysicalOperator *> GetChildren() const override;
29
29
 
30
30
  public:
31
- bool AllOperatorsPreserveOrder() const override;
32
31
  void BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) override;
33
32
  };
34
33
 
@@ -28,6 +28,10 @@ public:
28
28
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
29
29
  LocalSourceState &lstate) const override;
30
30
 
31
+ bool IsSource() const override {
32
+ return true;
33
+ }
34
+
31
35
  public:
32
36
  // Sink Interface
33
37
  SinkResultType Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
@@ -28,7 +28,7 @@ public:
28
28
  unique_ptr<Expression> offset_expression;
29
29
 
30
30
  public:
31
- bool IsOrderDependent() const override {
31
+ bool SinkOrderDependent() const override {
32
32
  return true;
33
33
  }
34
34
 
@@ -38,6 +38,10 @@ public:
38
38
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
39
39
  LocalSourceState &lstate) const override;
40
40
 
41
+ bool IsSource() const override {
42
+ return true;
43
+ }
44
+
41
45
  public:
42
46
  // Sink Interface
43
47
  SinkResultType Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
@@ -33,7 +33,7 @@ public:
33
33
  unique_ptr<Expression> offset_expression;
34
34
 
35
35
  public:
36
- bool IsOrderDependent() const override {
36
+ bool SinkOrderDependent() const override {
37
37
  return true;
38
38
  }
39
39
 
@@ -43,6 +43,10 @@ public:
43
43
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
44
44
  LocalSourceState &lstate) const override;
45
45
 
46
+ bool IsSource() const override {
47
+ return true;
48
+ }
49
+
46
50
  public:
47
51
  // Sink Interface
48
52
  unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
@@ -30,6 +30,10 @@ public:
30
30
  // Source interface
31
31
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
32
32
  LocalSourceState &lstate) const override;
33
+
34
+ bool IsSource() const override {
35
+ return true;
36
+ }
33
37
  };
34
38
 
35
39
  } // namespace duckdb
@@ -31,6 +31,7 @@ public:
31
31
  unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
32
32
 
33
33
  bool ParallelSink() const override;
34
+ bool SinkOrderDependent() const override;
34
35
  };
35
36
 
36
37
  } // namespace duckdb
@@ -34,6 +34,10 @@ public:
34
34
  // Source interface
35
35
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
36
36
  LocalSourceState &lstate) const override;
37
+
38
+ bool IsSource() const override {
39
+ return true;
40
+ }
37
41
  };
38
42
 
39
43
  } // namespace duckdb
@@ -31,6 +31,10 @@ public:
31
31
  // Source interface
32
32
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
33
33
  LocalSourceState &lstate) const override;
34
+
35
+ bool IsSource() const override {
36
+ return true;
37
+ }
34
38
  };
35
39
 
36
40
  } // namespace duckdb
@@ -28,6 +28,10 @@ public:
28
28
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
29
29
  LocalSourceState &lstate) const override;
30
30
 
31
+ bool IsSource() const override {
32
+ return true;
33
+ }
34
+
31
35
  public:
32
36
  // Sink interface
33
37
  SinkResultType Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
@@ -33,6 +33,10 @@ public:
33
33
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
34
34
  LocalSourceState &lstate) const override;
35
35
 
36
+ bool IsSource() const override {
37
+ return true;
38
+ }
39
+
36
40
  public:
37
41
  const std::string name;
38
42
  const SetScope scope;
@@ -37,8 +37,11 @@ public:
37
37
 
38
38
  public:
39
39
  vector<PhysicalOperator *> GetChildren() const override;
40
- bool AllOperatorsPreserveOrder() const override;
41
40
  void BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) override;
41
+
42
+ bool IsSource() const override {
43
+ return true;
44
+ }
42
45
  };
43
46
 
44
47
  } // namespace duckdb
@@ -33,6 +33,10 @@ public:
33
33
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
34
34
  LocalSourceState &lstate) const override;
35
35
 
36
+ bool IsSource() const override {
37
+ return true;
38
+ }
39
+
36
40
  static void SetExtensionVariable(ClientContext &context, ExtensionOption &extension_option, const string &name,
37
41
  SetScope scope, const Value &value);
38
42
 
@@ -35,7 +35,7 @@ public:
35
35
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
36
36
  GlobalOperatorState &gstate, OperatorState &state) const override;
37
37
 
38
- bool IsOrderDependent() const override;
38
+ OrderPreservationType OperatorOrder() const override;
39
39
  bool ParallelOperator() const override;
40
40
  };
41
41
 
@@ -29,6 +29,10 @@ public:
29
29
  public:
30
30
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
31
31
  LocalSourceState &lstate) const override;
32
+
33
+ bool IsSource() const override {
34
+ return true;
35
+ }
32
36
  };
33
37
 
34
38
  } // namespace duckdb
@@ -29,6 +29,10 @@ public:
29
29
  void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
30
30
  LocalSourceState &lstate) const override;
31
31
 
32
+ bool IsSource() const override {
33
+ return true;
34
+ }
35
+
32
36
  public:
33
37
  // Sink interface
34
38
  unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const override;
@@ -26,19 +26,17 @@ public:
26
26
  // Operator Interface
27
27
  unique_ptr<OperatorState> GetOperatorState(ExecutionContext &context) const override;
28
28
 
29
+ OrderPreservationType OperatorOrder() const override {
30
+ return OrderPreservationType::NO_ORDER;
31
+ }
29
32
  bool ParallelOperator() const override {
30
33
  return true;
31
34
  }
32
35
 
33
36
  protected:
34
- // CachingOperator Interface
35
37
  OperatorResultType ExecuteInternal(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
36
38
  GlobalOperatorState &gstate, OperatorState &state) const override;
37
39
 
38
- bool IsOrderPreserving() const override {
39
- return false;
40
- }
41
-
42
40
  public:
43
41
  // Sink Interface
44
42
  unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
@@ -51,6 +49,9 @@ public:
51
49
  bool ParallelSink() const override {
52
50
  return true;
53
51
  }
52
+ bool SinkOrderDependent() const override {
53
+ return false;
54
+ }
54
55
 
55
56
  public:
56
57
  void BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) override;
@@ -46,7 +46,10 @@ public:
46
46
  bool ParallelSink() const override {
47
47
  return true;
48
48
  }
49
- bool IsOrderPreserving() const override {
49
+ OrderPreservationType SourceOrder() const override {
50
+ return OrderPreservationType::NO_ORDER;
51
+ }
52
+ bool SinkOrderDependent() const override {
50
53
  return false;
51
54
  }
52
55
  string ParamsToString() const override;
@@ -55,6 +55,9 @@ public:
55
55
  public:
56
56
  unique_ptr<OperatorState> GetOperatorState(ExecutionContext &context) const override;
57
57
 
58
+ OrderPreservationType OperatorOrder() const override {
59
+ return OrderPreservationType::NO_ORDER;
60
+ }
58
61
  bool ParallelOperator() const override {
59
62
  return true;
60
63
  }
@@ -63,10 +66,6 @@ protected:
63
66
  OperatorResultType ExecuteInternal(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
64
67
  GlobalOperatorState &gstate, OperatorState &state) const override;
65
68
 
66
- bool IsOrderPreserving() const override {
67
- return false;
68
- }
69
-
70
69
  public:
71
70
  void BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) override;
72
71
  vector<const PhysicalOperator *> GetSources() const override;
@@ -37,7 +37,13 @@ public:
37
37
  void BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) override;
38
38
  vector<const PhysicalOperator *> GetSources() const override;
39
39
 
40
- bool IsOrderPreserving() const override {
40
+ OrderPreservationType SourceOrder() const override {
41
+ return OrderPreservationType::NO_ORDER;
42
+ }
43
+ OrderPreservationType OperatorOrder() const override {
44
+ return OrderPreservationType::NO_ORDER;
45
+ }
46
+ bool SinkOrderDependent() const override {
41
47
  return false;
42
48
  }
43
49
  };