diff --git a/duckpgq/include/duckpgq/operators/physical_path_finding.hpp b/duckpgq/include/duckpgq/operators/physical_path_finding.hpp index 22ba8590..b2bda204 100644 --- a/duckpgq/include/duckpgq/operators/physical_path_finding.hpp +++ b/duckpgq/include/duckpgq/operators/physical_path_finding.hpp @@ -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 -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 left, + PhysicalPathFinding(LogicalExtensionOperator &op, unique_ptr left, unique_ptr right); // vector join_key_types; @@ -61,12 +59,7 @@ namespace duckdb { return true; } - public: void BuildPipelines(Pipeline ¤t, 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 diff --git a/duckpgq/src/duckpgq/operators/path_finding_operator.cpp b/duckpgq/src/duckpgq/operators/path_finding_operator.cpp index 31add29b..0048545a 100644 --- a/duckpgq/src/duckpgq/operators/path_finding_operator.cpp +++ b/duckpgq/src/duckpgq/operators/path_finding_operator.cpp @@ -1,20 +1,19 @@ #include "duckpgq/operators/path_finding_operator.hpp" #include +#include namespace duckdb { - unique_ptr PathFindingOperator::CreatePlan(ClientContext &context, PhysicalPlanGenerator &generator) { - return unique_ptr(); // TODO IMPLEMENT ME - } - - duckdb::unique_ptr CreatePlan(duckdb::ClientContext &, - duckdb::PhysicalPlanGenerator &generator) override { - auto result = duckdb::make_uniq_base(bridge_id, types, - estimated_cardinality); + unique_ptr 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(*this, std::move(left), std::move(right)); + // auto plan = generator.CreatePlan(std::move(children[0])); + result->children.emplace_back(std::move(result)); return result; } -} \ No newline at end of file +} diff --git a/duckpgq/src/duckpgq/operators/physical_path_finding.cpp b/duckpgq/src/duckpgq/operators/physical_path_finding.cpp index d7762891..698ce7b6 100644 --- a/duckpgq/src/duckpgq/operators/physical_path_finding.cpp +++ b/duckpgq/src/duckpgq/operators/physical_path_finding.cpp @@ -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 +#include #include namespace duckdb { - PhysicalPathFinding::PhysicalPathFinding(LogicalComparisonJoin &op, unique_ptr left, + PhysicalPathFinding::PhysicalPathFinding(LogicalExtensionOperator &op, unique_ptr left, unique_ptr right) - : CachingPhysicalOperator(type, op.types, estimated_cardinality) { + : CachingPhysicalOperator(TYPE, op.types, 0) { + children.push_back(std::move(left)); + children.push_back(std::move(right)); } //===--------------------------------------------------------------------===//