Skip to content

Commit

Permalink
Update v size
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Nov 6, 2024
1 parent 805b3cf commit 76218ce
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/core/operator/physical_path_finding_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ PhysicalPathFinding::Combine(ExecutionContext &context,
OperatorSinkCombineInput &input) const {
auto &gstate = input.global_state.Cast<PathFindingGlobalSinkState>();
auto &lstate = input.local_state.Cast<PathFindingLocalSinkState>();
auto &client_profiler = QueryProfiler::Get(context.client);

if (gstate.child == 0) {
return SinkCombineResultType::FINISHED;
}
gstate.global_pairs->Combine(lstate.local_pairs);
client_profiler.Flush(context.thread.profiler);
return SinkCombineResultType::FINISHED;
}

Expand All @@ -223,11 +223,18 @@ PhysicalPathFinding::Finalize(Pipeline &pipeline, Event &event,
auto &global_tasks = gstate.global_pairs;
auto duckpgq_state = GetDuckPGQState(context);
// TODO
auto csr = duckpgq_state->GetCSR(0);
// Check if we have to do anything for CSR child
if (gstate.csr == nullptr) {
throw InternalException("CSR not initialized");
}
std::cout << gstate.csr->ToString() << std::endl;

// Check if we have to do anything for CSR child
if (gstate.child == 0) {
++gstate.child;
return SinkFinalizeType::READY;
}

if (gstate.child == 1 && global_tasks->Count() > 0) {
if (global_tasks->Count() > 0) {
auto all_pairs = make_shared_ptr<DataChunk>();
DataChunk pairs;
global_tasks->InitializeScanChunk(*all_pairs);
Expand All @@ -242,7 +249,7 @@ PhysicalPathFinding::Finalize(Pipeline &pipeline, Event &event,
idx_t num_threads = ts.NumberOfThreads();
idx_t mode = this->mode == "iterativelength" ? 0 : 1;
// TODO
gstate.global_bfs_state = make_uniq<GlobalBFSState>(all_pairs, 0,
gstate.global_bfs_state = make_uniq<GlobalBFSState>(all_pairs, gstate.csr->vsize,
num_threads, mode, context);

Value task_size_value;
Expand Down

0 comments on commit 76218ce

Please sign in to comment.