duckdb 0.4.1-dev1596.0 → 0.4.1-dev1598.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 +1 -1
- package/src/duckdb.cpp +31 -54
- package/src/duckdb.hpp +581 -584
- package/src/parquet-amalgamation.cpp +31408 -31408
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -78056,17 +78056,7 @@ void PhysicalUnion::BuildPipelines(Executor &executor, Pipeline ¤t, Pipeli
|
|
|
78056
78056
|
|
|
78057
78057
|
auto union_pipeline = make_shared<Pipeline>(executor);
|
|
78058
78058
|
auto pipeline_ptr = union_pipeline.get();
|
|
78059
|
-
auto &child_pipelines = state.GetChildPipelines(executor);
|
|
78060
|
-
auto &child_dependencies = state.GetChildDependencies(executor);
|
|
78061
78059
|
auto &union_pipelines = state.GetUnionPipelines(executor);
|
|
78062
|
-
// set up dependencies for any child pipelines to this union pipeline
|
|
78063
|
-
auto child_entry = child_pipelines.find(¤t);
|
|
78064
|
-
if (child_entry != child_pipelines.end()) {
|
|
78065
|
-
for (auto ¤t_child : child_entry->second) {
|
|
78066
|
-
D_ASSERT(child_dependencies.find(current_child.get()) != child_dependencies.end());
|
|
78067
|
-
child_dependencies[current_child.get()].push_back(pipeline_ptr);
|
|
78068
|
-
}
|
|
78069
|
-
}
|
|
78070
78060
|
// for the current pipeline, continue building on the LHS
|
|
78071
78061
|
state.SetPipelineOperators(*union_pipeline, state.GetPipelineOperators(current));
|
|
78072
78062
|
children[0]->BuildPipelines(executor, current, state);
|
|
@@ -147729,16 +147719,14 @@ struct ScheduleEventData {
|
|
|
147729
147719
|
ScheduleEventData(const vector<shared_ptr<Pipeline>> &pipelines,
|
|
147730
147720
|
unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> &child_pipelines,
|
|
147731
147721
|
unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> &union_pipelines,
|
|
147732
|
-
unordered_map<Pipeline *, vector<Pipeline *>> &child_dependencies,
|
|
147733
147722
|
vector<shared_ptr<Event>> &events, bool initial_schedule)
|
|
147734
|
-
: pipelines(pipelines), child_pipelines(child_pipelines), union_pipelines(union_pipelines),
|
|
147735
|
-
|
|
147723
|
+
: pipelines(pipelines), child_pipelines(child_pipelines), union_pipelines(union_pipelines), events(events),
|
|
147724
|
+
initial_schedule(initial_schedule) {
|
|
147736
147725
|
}
|
|
147737
147726
|
|
|
147738
147727
|
const vector<shared_ptr<Pipeline>> &pipelines;
|
|
147739
147728
|
unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> &child_pipelines;
|
|
147740
147729
|
unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> &union_pipelines;
|
|
147741
|
-
unordered_map<Pipeline *, vector<Pipeline *>> &child_dependencies;
|
|
147742
147730
|
unordered_map<Pipeline *, vector<Pipeline *>> scheduled_pipelines;
|
|
147743
147731
|
vector<shared_ptr<Event>> &events;
|
|
147744
147732
|
bool initial_schedule;
|
|
@@ -147802,13 +147790,10 @@ void Executor::SchedulePipeline(const shared_ptr<Pipeline> &pipeline, ScheduleEv
|
|
|
147802
147790
|
void Executor::ScheduleChildPipeline(Pipeline *parent, const shared_ptr<Pipeline> &pipeline,
|
|
147803
147791
|
ScheduleEventData &event_data) {
|
|
147804
147792
|
auto &events = event_data.events;
|
|
147805
|
-
auto &child_dependencies = event_data.child_dependencies;
|
|
147806
147793
|
pipeline->Ready();
|
|
147807
147794
|
|
|
147808
147795
|
auto child_ptr = pipeline.get();
|
|
147809
|
-
auto dependencies = child_dependencies.find(child_ptr);
|
|
147810
147796
|
D_ASSERT(event_data.union_pipelines.find(child_ptr) == event_data.union_pipelines.end());
|
|
147811
|
-
D_ASSERT(dependencies != child_dependencies.end());
|
|
147812
147797
|
// create the pipeline event and the event stack
|
|
147813
147798
|
auto pipeline_event = make_shared<PipelineEvent>(pipeline);
|
|
147814
147799
|
|
|
@@ -147818,30 +147803,39 @@ void Executor::ScheduleChildPipeline(Pipeline *parent, const shared_ptr<Pipeline
|
|
|
147818
147803
|
stack.pipeline_event = pipeline_event.get();
|
|
147819
147804
|
stack.pipeline_finish_event = parent_entry->second.pipeline_finish_event;
|
|
147820
147805
|
stack.pipeline_complete_event = parent_entry->second.pipeline_complete_event;
|
|
147821
|
-
|
|
147822
147806
|
// set up the dependencies for this child pipeline
|
|
147823
147807
|
unordered_set<Event *> finish_events;
|
|
147824
|
-
|
|
147825
|
-
|
|
147826
|
-
|
|
147827
|
-
|
|
147828
|
-
|
|
147829
|
-
|
|
147830
|
-
|
|
147808
|
+
|
|
147809
|
+
vector<Pipeline *> remaining_pipelines;
|
|
147810
|
+
unordered_set<Pipeline *> already_scheduled;
|
|
147811
|
+
remaining_pipelines.push_back(parent);
|
|
147812
|
+
for (idx_t i = 0; i < remaining_pipelines.size(); i++) {
|
|
147813
|
+
auto dep = remaining_pipelines[i];
|
|
147814
|
+
if (already_scheduled.find(dep) != already_scheduled.end()) {
|
|
147815
|
+
continue;
|
|
147831
147816
|
}
|
|
147832
|
-
|
|
147833
|
-
auto dep_entry = event_map.find(dep);
|
|
147834
|
-
D_ASSERT(dep_entry != event_map.end());
|
|
147835
|
-
D_ASSERT(dep_entry->second.pipeline_event);
|
|
147836
|
-
D_ASSERT(dep_entry->second.pipeline_finish_event);
|
|
147817
|
+
already_scheduled.insert(dep);
|
|
147837
147818
|
|
|
147838
|
-
|
|
147839
|
-
|
|
147840
|
-
|
|
147841
|
-
|
|
147842
|
-
finish_events.insert(finish_event);
|
|
147819
|
+
auto dep_scheduled = event_data.scheduled_pipelines.find(dep);
|
|
147820
|
+
if (dep_scheduled != event_data.scheduled_pipelines.end()) {
|
|
147821
|
+
for (auto &next_dep : dep_scheduled->second) {
|
|
147822
|
+
remaining_pipelines.push_back(next_dep);
|
|
147843
147823
|
}
|
|
147844
147824
|
}
|
|
147825
|
+
|
|
147826
|
+
auto dep_entry = event_map.find(dep);
|
|
147827
|
+
D_ASSERT(dep_entry != event_map.end());
|
|
147828
|
+
D_ASSERT(dep_entry->second.pipeline_event);
|
|
147829
|
+
D_ASSERT(dep_entry->second.pipeline_finish_event);
|
|
147830
|
+
|
|
147831
|
+
auto finish_event = dep_entry->second.pipeline_finish_event;
|
|
147832
|
+
stack.pipeline_event->AddDependency(*dep_entry->second.pipeline_event);
|
|
147833
|
+
if (finish_events.find(finish_event) == finish_events.end()) {
|
|
147834
|
+
finish_event->AddDependency(*stack.pipeline_event);
|
|
147835
|
+
finish_events.insert(finish_event);
|
|
147836
|
+
}
|
|
147837
|
+
|
|
147838
|
+
event_data.scheduled_pipelines[dep].push_back(child_ptr);
|
|
147845
147839
|
}
|
|
147846
147840
|
|
|
147847
147841
|
events.push_back(move(pipeline_event));
|
|
@@ -147891,15 +147885,13 @@ void Executor::ScheduleEventsInternal(ScheduleEventData &event_data) {
|
|
|
147891
147885
|
}
|
|
147892
147886
|
|
|
147893
147887
|
void Executor::ScheduleEvents() {
|
|
147894
|
-
ScheduleEventData event_data(pipelines, child_pipelines, union_pipelines,
|
|
147888
|
+
ScheduleEventData event_data(pipelines, child_pipelines, union_pipelines, events, true);
|
|
147895
147889
|
ScheduleEventsInternal(event_data);
|
|
147896
147890
|
}
|
|
147897
147891
|
|
|
147898
147892
|
void Executor::ReschedulePipelines(const vector<shared_ptr<Pipeline>> &pipelines, vector<shared_ptr<Event>> &events) {
|
|
147899
|
-
unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> child_pipelines;
|
|
147900
147893
|
unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> union_pipelines;
|
|
147901
|
-
|
|
147902
|
-
ScheduleEventData event_data(pipelines, child_pipelines, union_pipelines, child_dependencies, events, false);
|
|
147894
|
+
ScheduleEventData event_data(pipelines, child_pipelines, union_pipelines, events, false);
|
|
147903
147895
|
ScheduleEventsInternal(event_data);
|
|
147904
147896
|
}
|
|
147905
147897
|
|
|
@@ -148111,7 +148103,6 @@ void Executor::Reset() {
|
|
|
148111
148103
|
events.clear();
|
|
148112
148104
|
union_pipelines.clear();
|
|
148113
148105
|
child_pipelines.clear();
|
|
148114
|
-
child_dependencies.clear();
|
|
148115
148106
|
execution_result = PendingExecutionResult::RESULT_NOT_READY;
|
|
148116
148107
|
}
|
|
148117
148108
|
|
|
@@ -148120,7 +148111,6 @@ void Executor::AddChildPipeline(Pipeline *current) {
|
|
|
148120
148111
|
// found another operator that is a source
|
|
148121
148112
|
// schedule a child pipeline
|
|
148122
148113
|
auto child_pipeline = make_shared<Pipeline>(*this);
|
|
148123
|
-
auto child_pipeline_ptr = child_pipeline.get();
|
|
148124
148114
|
child_pipeline->sink = current->sink;
|
|
148125
148115
|
child_pipeline->operators = current->operators;
|
|
148126
148116
|
child_pipeline->source = current->operators.back();
|
|
@@ -148129,15 +148119,6 @@ void Executor::AddChildPipeline(Pipeline *current) {
|
|
|
148129
148119
|
|
|
148130
148120
|
vector<Pipeline *> dependencies;
|
|
148131
148121
|
dependencies.push_back(current);
|
|
148132
|
-
auto child_entry = child_pipelines.find(current);
|
|
148133
|
-
if (child_entry != child_pipelines.end()) {
|
|
148134
|
-
for (auto ¤t_child : child_entry->second) {
|
|
148135
|
-
D_ASSERT(child_dependencies.find(current_child.get()) != child_dependencies.end());
|
|
148136
|
-
child_dependencies[current_child.get()].push_back(child_pipeline_ptr);
|
|
148137
|
-
}
|
|
148138
|
-
}
|
|
148139
|
-
D_ASSERT(child_dependencies.find(child_pipeline_ptr) == child_dependencies.end());
|
|
148140
|
-
child_dependencies.insert(make_pair(child_pipeline_ptr, move(dependencies)));
|
|
148141
148122
|
child_pipelines[current].push_back(move(child_pipeline));
|
|
148142
148123
|
}
|
|
148143
148124
|
|
|
@@ -148540,10 +148521,6 @@ unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> &PipelineBuildState::Get
|
|
|
148540
148521
|
unordered_map<Pipeline *, vector<shared_ptr<Pipeline>>> &PipelineBuildState::GetChildPipelines(Executor &executor) {
|
|
148541
148522
|
return executor.child_pipelines;
|
|
148542
148523
|
}
|
|
148543
|
-
unordered_map<Pipeline *, vector<Pipeline *>> &PipelineBuildState::GetChildDependencies(Executor &executor) {
|
|
148544
|
-
return executor.child_dependencies;
|
|
148545
|
-
}
|
|
148546
|
-
|
|
148547
148524
|
vector<PhysicalOperator *> PipelineBuildState::GetPipelineOperators(Pipeline &pipeline) {
|
|
148548
148525
|
return pipeline.operators;
|
|
148549
148526
|
}
|