Skip to content

Commit

Permalink
Compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Dec 19, 2023
1 parent c32e0b6 commit 18019af
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
19 changes: 6 additions & 13 deletions duckpgq/include/duckpgq/operators/physical_path_finding.hpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
//===----------------------------------------------------------------------===//
// DuckDB
//
// duckdb/execution/operator/join/physical_piecewise_merge_join.hpp
// duckdb/execution/operator/join/physical_path_finding.hpp
//
//
//===----------------------------------------------------------------------===//

#pragma once

#include "duckdb/execution/operator/join/physical_range_join.hpp"
#include "duckdb/planner/bound_result_modifier.hpp"
#include <duckdb/planner/operator/logical_extension_operator.hpp>

namespace duckdb {
#include "duckdb/execution/physical_operator.hpp"

//! PhysicalIEJoin represents a two inequality range join between
//! two tables
namespace duckdb {
class PhysicalPathFinding : public CachingPhysicalOperator {
public:
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::PATH_FINDING;
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::EXTENSION;
public:
PhysicalPathFinding(LogicalComparisonJoin &op, unique_ptr<PhysicalOperator> left,
PhysicalPathFinding(LogicalExtensionOperator &op, unique_ptr<PhysicalOperator> left,
unique_ptr<PhysicalOperator> right);

// vector<LogicalType> join_key_types;
Expand Down Expand Up @@ -61,12 +59,7 @@ namespace duckdb {
return true;
}

public:
void BuildPipelines(Pipeline &current, MetaPipeline &meta_pipeline) override;

private:
// resolve joins that can potentially output N*M elements (INNER, LEFT, FULL)
// void ResolveComplexJoin(ExecutionContext &context, DataChunk &result, LocalSourceState &state) const;
};

} // namespace duckdb
21 changes: 10 additions & 11 deletions duckpgq/src/duckpgq/operators/path_finding_operator.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@

#include "duckpgq/operators/path_finding_operator.hpp"
#include <duckpgq_extension.hpp>
#include <duckpgq/operators/physical_path_finding.hpp>

namespace duckdb {
unique_ptr<PhysicalOperator> PathFindingOperator::CreatePlan(ClientContext &context, PhysicalPlanGenerator &generator) {
return unique_ptr<PhysicalOperator>(); // TODO IMPLEMENT ME
}

duckdb::unique_ptr<duckdb::PhysicalOperator> CreatePlan(duckdb::ClientContext &,
duckdb::PhysicalPlanGenerator &generator) override {
auto result = duckdb::make_uniq_base<duckdb::PhysicalOperator, PhysicalPathFinding>(bridge_id, types,
estimated_cardinality);
unique_ptr<PhysicalOperator> PathFindingOperator::CreatePlan(ClientContext &,
duckdb::PhysicalPlanGenerator &generator) {
D_ASSERT(children.size() == 2);
auto plan = generator.CreatePlan(std::move(children[0]));
result->children.emplace_back(std::move(plan));
auto left = generator.CreatePlan(std::move(children[0]));
auto right = generator.CreatePlan(std::move(children[1]));

auto result = duckdb::make_uniq_base<duckdb::PhysicalOperator, PhysicalPathFinding>(*this, std::move(left), std::move(right));
// auto plan = generator.CreatePlan(std::move(children[0]));
result->children.emplace_back(std::move(result));
return result;
}

}
}
8 changes: 6 additions & 2 deletions duckpgq/src/duckpgq/operators/physical_path_finding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@
#include "duckdb/parallel/event.hpp"
#include "duckdb/parallel/meta_pipeline.hpp"
#include "duckdb/parallel/thread_context.hpp"
#include "duckdb/execution/physical_operator.hpp"

#include <thread>
#include <duckdb/execution/operator/join/physical_range_join.hpp>
#include <duckdb/planner/operator/logical_comparison_join.hpp>


namespace duckdb {

PhysicalPathFinding::PhysicalPathFinding(LogicalComparisonJoin &op, unique_ptr<PhysicalOperator> left,
PhysicalPathFinding::PhysicalPathFinding(LogicalExtensionOperator &op, unique_ptr<PhysicalOperator> left,
unique_ptr<PhysicalOperator> right)
: CachingPhysicalOperator(type, op.types, estimated_cardinality) {
: CachingPhysicalOperator(TYPE, op.types, 0) {
children.push_back(std::move(left));
children.push_back(std::move(right));
}

//===--------------------------------------------------------------------===//
Expand Down

0 comments on commit 18019af

Please sign in to comment.