Skip to content

Commit

Permalink
finish first pass documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
connortsui20 committed Jan 30, 2025
1 parent af20bac commit 06b0141
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 1 deletion.
4 changes: 4 additions & 0 deletions optd-core/src/operator/relational/logical/filter.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
//! A logical filter.
/// Logical filter operator that selects rows matching a condition.
///
/// Takes input relation (`Relation`) and filters rows using a boolean predicate (`Scalar`).
#[derive(Clone)]
pub struct Filter<Relation, Scalar> {
/// The input relation.
pub child: Relation,
/// The filter expression denoting the predicate condition for this filter operation.
pub predicate: Scalar,
}
6 changes: 6 additions & 0 deletions optd-core/src/operator/relational/logical/join.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
//! A logical join.
/// Logical join operator that combines rows from two relations.
///
/// Takes left and right relations (`Relation`) and joins their rows using a join condition
/// (`Scalar`).
#[derive(Clone)]
pub struct Join<Relation, Scalar> {
/// TODO(alexis) Mocked for now.
pub join_type: String,
/// The left input relation.
pub left: Relation,
/// The right input relation.
pub right: Relation,
/// The join expression denoting the join condition that links the two input relations.
pub condition: Scalar,
}
1 change: 1 addition & 0 deletions optd-core/src/operator/relational/logical/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use scan::Scan;
/// [`LogicalPlan`]: crate::plan::logical_plan::LogicalPlan
/// [`PartialLogicalPlan`]: crate::plan::partial_logical_plan::PartialLogicalPlan
/// [`LogicalExpression`]: crate::expression::LogicalExpression
#[allow(missing_docs)]
#[derive(Clone)]
pub enum LogicalOperator<Relation, Scalar> {
Scan(Scan<Scalar>),
Expand Down
4 changes: 4 additions & 0 deletions optd-core/src/operator/relational/logical/project.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
//! A logical projection.
/// Logical project operator that specifies output columns.
///
/// Takes input relation (`Relation`) and defines output columns/expressions
/// (`Scalar`).
#[derive(Clone)]
pub struct Project<Relation, Scalar> {
/// The input relation.
pub child: Relation,
/// TODO(everyone): What exactly is going on here?
pub fields: Vec<Scalar>,
}
6 changes: 5 additions & 1 deletion optd-core/src/operator/relational/logical/scan.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
//! A logical scan.
/// Logical scan operator that reads from a base table.
///
/// Reads from table (`String`) and optionally filters rows using a pushdown predicate
/// (`Scalar`).
#[derive(Clone)]
pub struct Scan<Scalar> {
pub table_name: String, // TODO(alexis): Mocked for now.
/// TODO(alexis) Mocked for now.
pub table_name: String,
/// An optional filter expression for predicate pushdown into scan operators.
pub predicate: Option<Scalar>,
}
7 changes: 7 additions & 0 deletions optd-core/src/operator/relational/physical/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
//! Type definitions of physical operators in optd.
// TODO(connor):
// The module structure here is somewhat questionable, as it has multiple physical operators that
// should really only have 1 implementor (filter and project).
// For now, we can hold off on documenting stuff here until that is stabilized.
#![allow(missing_docs)]

pub mod filter;
pub mod join;
pub mod project;
Expand All @@ -22,6 +28,7 @@ use scan::table_scan::TableScan;
///
/// [`PhysicalPlan`]: crate::plan::physical_plan::PhysicalPlan
/// [`PhysicalExpression`]: crate::expression::PhysicalExpression
#[allow(missing_docs)]
#[derive(Clone)]
pub enum PhysicalOperator<Relation, Scalar> {
TableScan(TableScan<Scalar>),
Expand Down
4 changes: 4 additions & 0 deletions optd-core/src/operator/scalar/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
//! Type definitions for scalar operators.
// For now, we can hold off on documenting stuff here until that is stabilized.
#![allow(missing_docs)]

pub mod add;
pub mod column_ref;
pub mod constants;
Expand Down

0 comments on commit 06b0141

Please sign in to comment.