Skip to content

Commit

Permalink
fix plan types
Browse files Browse the repository at this point in the history
  • Loading branch information
connortsui20 committed Jan 27, 2025
1 parent a5ca041 commit 469b36c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
7 changes: 2 additions & 5 deletions infra/src/types/plan/logical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use std::sync::Arc;
/// The root of the plan DAG _cannot_ be a scalar operator (and thus for now can only be a logical
/// operator).
#[derive(Clone)]
pub enum LogicalPlan {
LogicalRoot(Arc<LogicalOperator<LogicalLink>>),
pub struct LogicalPlan {
root: Arc<LogicalOperator<LogicalLink>>,
}

/// A link in a [`LogicalPlan`] to a node.
Expand All @@ -26,9 +26,6 @@ pub enum LogicalPlan {
///
/// - [`super::logical_plan::LogicalLink`] only allows a logical operator to have other logical
/// operators or scalar operators as children since that is all [`LogicalPlan`] needs
/// - [`super::physical_plan::LogicalLink`] allows a logical operator to also have a physical
/// operator as a child (since [`PhysicalPlan`] needs to encode both logical and physical
/// operators).
/// - [`super::partial_logical_plan::LogicalLink`] allows a logical operator to also have a
/// [`GroupId`] as a child (since the [`PartialLogicalPlan`] is a partially materialized query
/// plan).
Expand Down
18 changes: 5 additions & 13 deletions infra/src/types/plan/physical_plan.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
use crate::types::operator::{logical::LogicalOperator, physical::PhysicalOperator, ScalarOperator};
use crate::types::operator::{
logical::LogicalOperator, physical::PhysicalOperator, ScalarOperator,
};
use std::sync::Arc;

/// TODO Add docs.
#[derive(Clone)]
pub enum PhysicalPlan {
LogicalRoot(LogicalLink),
PhysicalRoot(PhysicalLink),
}

/// TODO Add docs.
#[allow(clippy::enum_variant_names)]
#[derive(Clone)]
pub enum LogicalLink {
LogicalNode(Arc<LogicalOperator<LogicalLink>>),
PhysicalNode(Arc<PhysicalOperator<PhysicalLink>>),
ScalarNode(Arc<ScalarOperator<ScalarLink>>),
pub struct PhysicalPlan {
root: Arc<PhysicalOperator<PhysicalLink>>,
}

/// TODO Add docs.
Expand Down

0 comments on commit 469b36c

Please sign in to comment.