duckdb 0.3.3-dev1387.0 → 0.3.3-dev1397.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.3.3-dev1387.0",
4
+ "version": "0.3.3-dev1397.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -53138,10 +53138,11 @@ public:
53138
53138
  vector<unique_ptr<Expression>> select_list;
53139
53139
 
53140
53140
  public:
53141
+ unique_ptr<GlobalOperatorState> GetGlobalOperatorState(ClientContext &context) const override;
53141
53142
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
53142
53143
 
53143
53144
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
53144
- OperatorState &state) const override;
53145
+ GlobalOperatorState &gstate, OperatorState &state) const override;
53145
53146
 
53146
53147
  string ParamsToString() const override;
53147
53148
  };
@@ -53161,9 +53162,18 @@ PhysicalStreamingWindow::PhysicalStreamingWindow(vector<LogicalType> types, vect
53161
53162
  : PhysicalOperator(type, move(types), estimated_cardinality), select_list(move(select_list)) {
53162
53163
  }
53163
53164
 
53165
+ class StreamingWindowGlobalState : public GlobalOperatorState {
53166
+ public:
53167
+ StreamingWindowGlobalState() : row_number(1) {
53168
+ }
53169
+
53170
+ //! The next row number.
53171
+ std::atomic<int64_t> row_number;
53172
+ };
53173
+
53164
53174
  class StreamingWindowState : public OperatorState {
53165
53175
  public:
53166
- StreamingWindowState() : initialized(false), row_number(1) {
53176
+ StreamingWindowState() : initialized(false) {
53167
53177
  }
53168
53178
 
53169
53179
  void Initialize(DataChunk &input, const vector<unique_ptr<Expression>> &expressions) {
@@ -53194,16 +53204,20 @@ public:
53194
53204
 
53195
53205
  public:
53196
53206
  bool initialized;
53197
- int64_t row_number;
53198
53207
  vector<unique_ptr<Vector>> const_vectors;
53199
53208
  };
53200
53209
 
53210
+ unique_ptr<GlobalOperatorState> PhysicalStreamingWindow::GetGlobalOperatorState(ClientContext &context) const {
53211
+ return make_unique<StreamingWindowGlobalState>();
53212
+ }
53213
+
53201
53214
  unique_ptr<OperatorState> PhysicalStreamingWindow::GetOperatorState(ClientContext &context) const {
53202
53215
  return make_unique<StreamingWindowState>();
53203
53216
  }
53204
53217
 
53205
53218
  OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
53206
- OperatorState &state_p) const {
53219
+ GlobalOperatorState &gstate_p, OperatorState &state_p) const {
53220
+ auto &gstate = (StreamingWindowGlobalState &)gstate_p;
53207
53221
  auto &state = (StreamingWindowState &)state_p;
53208
53222
  if (!state.initialized) {
53209
53223
  state.Initialize(input, select_list);
@@ -53230,7 +53244,7 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D
53230
53244
  // Set row numbers
53231
53245
  auto rdata = FlatVector::GetData<int64_t>(chunk.data[col_idx]);
53232
53246
  for (idx_t i = 0; i < count; i++) {
53233
- rdata[i] = state.row_number + i;
53247
+ rdata[i] = gstate.row_number + i;
53234
53248
  }
53235
53249
  break;
53236
53250
  }
@@ -53238,7 +53252,7 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D
53238
53252
  throw NotImplementedException("%s for StreamingWindow", ExpressionTypeToString(expr.GetExpressionType()));
53239
53253
  }
53240
53254
  }
53241
- state.row_number += count;
53255
+ gstate.row_number += count;
53242
53256
  chunk.SetCardinality(count);
53243
53257
  return OperatorResultType::NEED_MORE_INPUT;
53244
53258
  }
@@ -54828,7 +54842,7 @@ public:
54828
54842
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
54829
54843
 
54830
54844
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
54831
- OperatorState &state) const override;
54845
+ GlobalOperatorState &gstate, OperatorState &state) const override;
54832
54846
 
54833
54847
  bool ParallelOperator() const override {
54834
54848
  return true;
@@ -54881,7 +54895,7 @@ unique_ptr<OperatorState> PhysicalFilter::GetOperatorState(ClientContext &contex
54881
54895
  }
54882
54896
 
54883
54897
  OperatorResultType PhysicalFilter::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
54884
- OperatorState &state_p) const {
54898
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
54885
54899
  auto &state = (FilterState &)state_p;
54886
54900
  idx_t result_count = state.executor.SelectExpression(input, state.sel);
54887
54901
  if (result_count == input.size()) {
@@ -56051,7 +56065,7 @@ public:
56051
56065
  // Operator interface
56052
56066
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
56053
56067
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
56054
- OperatorState &state) const override;
56068
+ GlobalOperatorState &gstate, OperatorState &state) const override;
56055
56069
 
56056
56070
  bool ParallelOperator() const override {
56057
56071
  return true;
@@ -56120,7 +56134,7 @@ unique_ptr<OperatorState> PhysicalStreamingSample::GetOperatorState(ClientContex
56120
56134
  }
56121
56135
 
56122
56136
  OperatorResultType PhysicalStreamingSample::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
56123
- OperatorState &state) const {
56137
+ GlobalOperatorState &gstate, OperatorState &state) const {
56124
56138
  switch (method) {
56125
56139
  case SampleMethod::BERNOULLI_SAMPLE:
56126
56140
  BernoulliSample(input, chunk, state);
@@ -56450,7 +56464,7 @@ public:
56450
56464
  // Operator Interface
56451
56465
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
56452
56466
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
56453
- OperatorState &state) const override;
56467
+ GlobalOperatorState &gstate, OperatorState &state) const override;
56454
56468
 
56455
56469
  bool ParallelOperator() const override {
56456
56470
  return true;
@@ -56784,7 +56798,7 @@ public:
56784
56798
  // Operator Interface
56785
56799
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
56786
56800
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
56787
- OperatorState &state) const override;
56801
+ GlobalOperatorState &gstate, OperatorState &state) const override;
56788
56802
 
56789
56803
  bool ParallelOperator() const override {
56790
56804
  return true;
@@ -56923,7 +56937,7 @@ unique_ptr<OperatorState> PhysicalBlockwiseNLJoin::GetOperatorState(ClientContex
56923
56937
  }
56924
56938
 
56925
56939
  OperatorResultType PhysicalBlockwiseNLJoin::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
56926
- OperatorState &state_p) const {
56940
+ GlobalOperatorState &gstate_p, OperatorState &state_p) const {
56927
56941
  D_ASSERT(input.size() > 0);
56928
56942
  auto &state = (BlockwiseNLJoinState &)state_p;
56929
56943
  auto &gstate = (BlockwiseNLJoinGlobalState &)*sink_state;
@@ -57186,7 +57200,7 @@ public:
57186
57200
  // Operator Interface
57187
57201
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
57188
57202
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
57189
- OperatorState &state) const override;
57203
+ GlobalOperatorState &gstate, OperatorState &state) const override;
57190
57204
 
57191
57205
  bool ParallelOperator() const override {
57192
57206
  return true;
@@ -57264,7 +57278,7 @@ unique_ptr<OperatorState> PhysicalCrossProduct::GetOperatorState(ClientContext &
57264
57278
  }
57265
57279
 
57266
57280
  OperatorResultType PhysicalCrossProduct::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
57267
- OperatorState &state_p) const {
57281
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
57268
57282
  auto &state = (CrossProductOperatorState &)state_p;
57269
57283
  auto &sink = (CrossProductGlobalState &)*sink_state;
57270
57284
  auto &right_collection = sink.rhs_materialized;
@@ -57767,7 +57781,7 @@ unique_ptr<OperatorState> PhysicalHashJoin::GetOperatorState(ClientContext &cont
57767
57781
  }
57768
57782
 
57769
57783
  OperatorResultType PhysicalHashJoin::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
57770
- OperatorState &state_p) const {
57784
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
57771
57785
  auto &state = (PhysicalHashJoinState &)state_p;
57772
57786
  auto &sink = (HashJoinGlobalState &)*sink_state;
57773
57787
  D_ASSERT(sink.finalized);
@@ -57868,7 +57882,7 @@ public:
57868
57882
  public:
57869
57883
  // Operator Interface
57870
57884
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
57871
- OperatorState &state) const override;
57885
+ GlobalOperatorState &gstate, OperatorState &state) const override;
57872
57886
 
57873
57887
  public:
57874
57888
  // Source interface
@@ -59079,7 +59093,7 @@ void PhysicalIEJoin::ResolveComplexJoin(ExecutionContext &context, DataChunk &ch
59079
59093
  }
59080
59094
 
59081
59095
  OperatorResultType PhysicalIEJoin::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
59082
- OperatorState &state) const {
59096
+ GlobalOperatorState &gstate, OperatorState &state) const {
59083
59097
  return OperatorResultType::FINISHED;
59084
59098
  }
59085
59099
 
@@ -59366,7 +59380,7 @@ public:
59366
59380
  public:
59367
59381
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
59368
59382
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
59369
- OperatorState &state) const override;
59383
+ GlobalOperatorState &gstate, OperatorState &state) const override;
59370
59384
 
59371
59385
  bool ParallelOperator() const override {
59372
59386
  return true;
@@ -59652,7 +59666,7 @@ void PhysicalIndexJoin::GetRHSMatches(ExecutionContext &context, DataChunk &inpu
59652
59666
  }
59653
59667
 
59654
59668
  OperatorResultType PhysicalIndexJoin::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
59655
- OperatorState &state_p) const {
59669
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
59656
59670
  auto &state = (IndexJoinOperatorState &)state_p;
59657
59671
 
59658
59672
  state.result_size = 0;
@@ -59729,7 +59743,7 @@ public:
59729
59743
  // Operator Interface
59730
59744
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
59731
59745
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
59732
- OperatorState &state) const override;
59746
+ GlobalOperatorState &gstate, OperatorState &state) const override;
59733
59747
 
59734
59748
  bool ParallelOperator() const override {
59735
59749
  return true;
@@ -60017,7 +60031,7 @@ unique_ptr<OperatorState> PhysicalNestedLoopJoin::GetOperatorState(ClientContext
60017
60031
  }
60018
60032
 
60019
60033
  OperatorResultType PhysicalNestedLoopJoin::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
60020
- OperatorState &state_p) const {
60034
+ GlobalOperatorState &gstate_p, OperatorState &state_p) const {
60021
60035
  auto &gstate = (NestedLoopJoinGlobalState &)*sink_state;
60022
60036
 
60023
60037
  if (gstate.right_chunks.Count() == 0) {
@@ -60239,7 +60253,7 @@ public:
60239
60253
  // Operator Interface
60240
60254
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
60241
60255
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
60242
- OperatorState &state) const override;
60256
+ GlobalOperatorState &gstate, OperatorState &state) const override;
60243
60257
 
60244
60258
  bool ParallelOperator() const override {
60245
60259
  return true;
@@ -61227,7 +61241,7 @@ OperatorResultType PhysicalPiecewiseMergeJoin::ResolveComplexJoin(ExecutionConte
61227
61241
  }
61228
61242
 
61229
61243
  OperatorResultType PhysicalPiecewiseMergeJoin::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
61230
- OperatorState &state) const {
61244
+ GlobalOperatorState &gstate_p, OperatorState &state) const {
61231
61245
  auto &gstate = (MergeJoinGlobalState &)*sink_state;
61232
61246
 
61233
61247
  if (gstate.Count() == 0) {
@@ -64966,7 +64980,7 @@ public:
64966
64980
  public:
64967
64981
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
64968
64982
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
64969
- OperatorState &state) const override;
64983
+ GlobalOperatorState &gstate, OperatorState &state) const override;
64970
64984
 
64971
64985
  bool ParallelOperator() const override {
64972
64986
  return true;
@@ -65002,7 +65016,7 @@ PhysicalProjection::PhysicalProjection(vector<LogicalType> types, vector<unique_
65002
65016
  }
65003
65017
 
65004
65018
  OperatorResultType PhysicalProjection::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
65005
- OperatorState &state_p) const {
65019
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
65006
65020
  auto &state = (ProjectionState &)state_p;
65007
65021
  state.executor.Execute(input, chunk);
65008
65022
  return OperatorResultType::NEED_MORE_INPUT;
@@ -65047,7 +65061,7 @@ public:
65047
65061
  public:
65048
65062
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
65049
65063
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
65050
- OperatorState &state) const override;
65064
+ GlobalOperatorState &gstate, OperatorState &state) const override;
65051
65065
 
65052
65066
  bool ParallelOperator() const override {
65053
65067
  return true;
@@ -65088,7 +65102,7 @@ unique_ptr<OperatorState> PhysicalTableInOutFunction::GetOperatorState(ClientCon
65088
65102
  }
65089
65103
 
65090
65104
  OperatorResultType PhysicalTableInOutFunction::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
65091
- OperatorState &state_p) const {
65105
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
65092
65106
  auto &state = (TableInOutFunctionState &)state_p;
65093
65107
 
65094
65108
  if (!state.initialized) {
@@ -65131,7 +65145,7 @@ public:
65131
65145
  public:
65132
65146
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
65133
65147
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
65134
- OperatorState &state) const override;
65148
+ GlobalOperatorState &gstate, OperatorState &state) const override;
65135
65149
 
65136
65150
  bool ParallelOperator() const override {
65137
65151
  return true;
@@ -65291,7 +65305,7 @@ unique_ptr<OperatorState> PhysicalUnnest::GetOperatorState(ClientContext &contex
65291
65305
  }
65292
65306
 
65293
65307
  OperatorResultType PhysicalUnnest::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
65294
- OperatorState &state_p) const {
65308
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
65295
65309
  auto &state = (UnnestOperatorState &)state_p;
65296
65310
  do {
65297
65311
  if (state.first_fetch) {
@@ -65579,7 +65593,7 @@ public:
65579
65593
  public:
65580
65594
  unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const override;
65581
65595
  OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
65582
- OperatorState &state) const override;
65596
+ GlobalOperatorState &gstate, OperatorState &state) const override;
65583
65597
 
65584
65598
  bool ParallelOperator() const override {
65585
65599
  return true;
@@ -65614,7 +65628,7 @@ unique_ptr<OperatorState> PhysicalExpressionScan::GetOperatorState(ClientContext
65614
65628
  }
65615
65629
 
65616
65630
  OperatorResultType PhysicalExpressionScan::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
65617
- OperatorState &state_p) const {
65631
+ GlobalOperatorState &gstate, OperatorState &state_p) const {
65618
65632
  auto &state = (ExpressionScanState &)state_p;
65619
65633
 
65620
65634
  for (; chunk.size() + input.size() <= STANDARD_VECTOR_SIZE && state.expression_index < expressions.size();
@@ -66761,6 +66775,11 @@ void PhysicalRecursiveCTE::ExecuteRecursivePipelines(ExecutionContext &context)
66761
66775
  // reset the sink state for any intermediate sinks
66762
66776
  sink->sink_state = sink->GetGlobalSinkState(context.client);
66763
66777
  }
66778
+ for (auto &op : pipeline->GetOperators()) {
66779
+ if (op) {
66780
+ op->op_state = op->GetGlobalOperatorState(context.client);
66781
+ }
66782
+ }
66764
66783
  pipeline->Reset();
66765
66784
  }
66766
66785
  auto &executor = pipelines[0]->executor;
@@ -67315,8 +67334,12 @@ unique_ptr<OperatorState> PhysicalOperator::GetOperatorState(ClientContext &cont
67315
67334
  return make_unique<OperatorState>();
67316
67335
  }
67317
67336
 
67337
+ unique_ptr<GlobalOperatorState> PhysicalOperator::GetGlobalOperatorState(ClientContext &context) const {
67338
+ return make_unique<GlobalOperatorState>();
67339
+ }
67340
+
67318
67341
  OperatorResultType PhysicalOperator::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
67319
- OperatorState &state) const {
67342
+ GlobalOperatorState &gstate, OperatorState &state) const {
67320
67343
  throw InternalException("Calling Execute on a node that is not an operator!");
67321
67344
  }
67322
67345
  // LCOV_EXCL_STOP
@@ -74864,9 +74887,9 @@ struct VectorMinMaxBase {
74864
74887
  const auto sidx = sdata.sel->get_index(i);
74865
74888
  auto state = states[sidx];
74866
74889
  if (!state->value) {
74867
- Assign(state, input, idx);
74890
+ Assign(state, input, i);
74868
74891
  } else {
74869
- OP::template Execute(state, input, idx, count);
74892
+ OP::template Execute(state, input, i, count);
74870
74893
  }
74871
74894
  }
74872
74895
  }
@@ -74885,10 +74908,19 @@ struct VectorMinMaxBase {
74885
74908
  template <class T, class STATE>
74886
74909
  static void Finalize(Vector &result, FunctionData *, STATE *state, T *target, ValidityMask &mask, idx_t idx) {
74887
74910
  if (!state->value) {
74888
- // we need to use FlatVector::SetNull here
74911
+ // we need to use SetNull here
74889
74912
  // since for STRUCT columns only setting the validity mask of the struct is incorrect
74890
74913
  // as for a struct column, we need to also set ALL child columns to NULL
74891
- FlatVector::SetNull(result, idx, true);
74914
+ switch (result.GetVectorType()) {
74915
+ case VectorType::FLAT_VECTOR:
74916
+ FlatVector::SetNull(result, idx, true);
74917
+ break;
74918
+ case VectorType::CONSTANT_VECTOR:
74919
+ ConstantVector::SetNull(result, true);
74920
+ break;
74921
+ default:
74922
+ throw InternalException("Invalid result vector type for nested min/max");
74923
+ }
74892
74924
  } else {
74893
74925
  VectorOperations::Copy(*state->value, result, 1, 0, idx);
74894
74926
  }
@@ -104615,8 +104647,12 @@ void duckdb_destroy_value(duckdb_value *value) {
104615
104647
  }
104616
104648
  }
104617
104649
 
104650
+ duckdb_value duckdb_create_varchar_length(const char *text, idx_t length) {
104651
+ return (duckdb_value) new duckdb::Value(std::string(text, length));
104652
+ }
104653
+
104618
104654
  duckdb_value duckdb_create_varchar(const char *text) {
104619
- return (duckdb_value) new duckdb::Value(text);
104655
+ return duckdb_create_varchar_length(text, strlen(text));
104620
104656
  }
104621
104657
 
104622
104658
  duckdb_value duckdb_create_int64(int64_t input) {
@@ -131644,6 +131680,7 @@ void Executor::AddChildPipeline(Pipeline *current) {
131644
131680
 
131645
131681
  void Executor::BuildPipelines(PhysicalOperator *op, Pipeline *current) {
131646
131682
  D_ASSERT(current);
131683
+ op->op_state.reset();
131647
131684
  if (op->IsSink()) {
131648
131685
  // operator is a sink, build a pipeline
131649
131686
  op->sink_state.reset();
@@ -132146,6 +132183,13 @@ void Pipeline::Reset() {
132146
132183
  if (sink && !sink->sink_state) {
132147
132184
  sink->sink_state = sink->GetGlobalSinkState(GetClientContext());
132148
132185
  }
132186
+
132187
+ for (auto &op : operators) {
132188
+ if (op && !op->op_state) {
132189
+ op->op_state = op->GetGlobalOperatorState(GetClientContext());
132190
+ }
132191
+ }
132192
+
132149
132193
  ResetSource();
132150
132194
  }
132151
132195
 
@@ -132514,7 +132558,7 @@ OperatorResultType PipelineExecutor::Execute(DataChunk &input, DataChunk &result
132514
132558
  // if current_idx > source_idx, we pass the previous' operators output through the Execute of the current
132515
132559
  // operator
132516
132560
  StartOperator(current_operator);
132517
- auto result = current_operator->Execute(context, prev_chunk, current_chunk,
132561
+ auto result = current_operator->Execute(context, prev_chunk, current_chunk, *current_operator->op_state,
132518
132562
  *intermediate_states[current_intermediate - 1]);
132519
132563
  EndOperator(current_operator, &current_chunk);
132520
132564
  if (result == OperatorResultType::HAVE_MORE_OUTPUT) {
package/src/duckdb.hpp CHANGED
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
13
  #define DUCKDB_AMALGAMATION_EXTENDED 1
14
- #define DUCKDB_SOURCE_ID "a69a377f6"
15
- #define DUCKDB_VERSION "v0.3.3-dev1387"
14
+ #define DUCKDB_SOURCE_ID "c3ba7e5b0"
15
+ #define DUCKDB_VERSION "v0.3.3-dev1397"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -10172,6 +10172,12 @@ public:
10172
10172
  }
10173
10173
  };
10174
10174
 
10175
+ class GlobalOperatorState {
10176
+ public:
10177
+ virtual ~GlobalOperatorState() {
10178
+ }
10179
+ };
10180
+
10175
10181
  class GlobalSinkState {
10176
10182
  public:
10177
10183
  GlobalSinkState() : state(SinkFinalizeType::READY) {
@@ -10225,6 +10231,8 @@ public:
10225
10231
  idx_t estimated_cardinality;
10226
10232
  //! The global sink state of this operator
10227
10233
  unique_ptr<GlobalSinkState> sink_state;
10234
+ //! The global state of this operator
10235
+ unique_ptr<GlobalOperatorState> op_state;
10228
10236
 
10229
10237
  public:
10230
10238
  virtual string GetName() const;
@@ -10246,8 +10254,9 @@ public:
10246
10254
  public:
10247
10255
  // Operator interface
10248
10256
  virtual unique_ptr<OperatorState> GetOperatorState(ClientContext &context) const;
10257
+ virtual unique_ptr<GlobalOperatorState> GetGlobalOperatorState(ClientContext &context) const;
10249
10258
  virtual OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
10250
- OperatorState &state) const;
10259
+ GlobalOperatorState &gstate, OperatorState &state) const;
10251
10260
 
10252
10261
  virtual bool ParallelOperator() const {
10253
10262
  return false;
@@ -10630,7 +10639,7 @@ class Pipeline : public std::enable_shared_from_this<Pipeline> {
10630
10639
  friend class PipelineFinishEvent;
10631
10640
 
10632
10641
  public:
10633
- Pipeline(Executor &execution_context);
10642
+ explicit Pipeline(Executor &execution_context);
10634
10643
 
10635
10644
  Executor &executor;
10636
10645
 
@@ -15887,13 +15896,22 @@ Destroys the value and de-allocates all memory allocated for that type.
15887
15896
  DUCKDB_API void duckdb_destroy_value(duckdb_value *value);
15888
15897
 
15889
15898
  /*!
15890
- Creates a value from a varchar
15899
+ Creates a value from a null-terminated string
15891
15900
 
15892
- * value: The varchar value
15901
+ * value: The null-terminated string
15893
15902
  * returns: The value. This must be destroyed with `duckdb_destroy_value`.
15894
15903
  */
15895
15904
  DUCKDB_API duckdb_value duckdb_create_varchar(const char *text);
15896
15905
 
15906
+ /*!
15907
+ Creates a value from a string
15908
+
15909
+ * value: The text
15910
+ * length: The length of the text
15911
+ * returns: The value. This must be destroyed with `duckdb_destroy_value`.
15912
+ */
15913
+ DUCKDB_API duckdb_value duckdb_create_varchar_length(const char *text, idx_t length);
15914
+
15897
15915
  /*!
15898
15916
  Creates a value from an int64
15899
15917