bobzhang/sqlglot/planner does not have a README file

    JoinInfo

    pub struct JoinInfo {
    side : String
    join_key : Array[
    Expr
    ]
    source_key : Array[
    Expr
    ]
    condition :
    Expr

    }

    The join information of a Join step.

    Plan

    pub struct Plan {
    expression :
    Expr

    ctes :
    Expr
    ?
    root : Step
    }

    An execution plan: a DAG of steps.

    Plan::dag

    fn Plan::dag(self : Plan) -> Array[(Step, Array[Step])]

    The plan's DAG: each step and its dependencies.

    Plan::leaves

    fn Plan::leaves(self : Plan) -> Array[Step]

    Steps without dependencies.

    Plan::to_string

    fn Plan::to_string(self : Plan) -> String

    Step

    pub struct Step {
    uid : Int
    kind : StepKind
    name : String?
    dependencies : Array[Step]
    dependents : Array[Step]
    projections : Array[
    Expr
    ]
    limit : Int64?
    offset : Int64
    condition :
    Expr
    ?
    source :
    Expr
    ?
    source_name : String?
    joins : Array[(String, JoinInfo)]
    aggregations : Array[
    Expr
    ]
    operands : Array[
    Expr
    ]
    group : Array[(String,
    Expr
    )]
    agg_source : String?
    key : Array[
    Expr
    ]
    op :
    Kind
    ?
    left : String
    right : String
    distinct : Bool
    }

    A step of an execution plan.

    Step::add_dependency

    fn Step::add_dependency(self : Step, dependency : Step) -> Unit

    Step::id

    fn Step::id(self : Step) -> String

    Step.id: e.g. Scan: x (12).

    Step::to_s

    fn Step::to_s(self : Step, level? : Int) -> String

    A readable representation of the step and its dependencies.

    Step::type_name

    fn Step::type_name(self : Step) -> String

    StepKind

    pub(all) enum StepKind {
    Scan
    Join
    Aggregate
    Sort
    SetOperation
    } derive(Eq,
    Debug
    )

    step_from_expression

    fn step_from_expression(expression :
    Expr
    , ctes : Map[String, Step]) -> Step raise
    SqlglotError

    Builds a DAG of Steps from a SQL expression (tables and subqueries must be aliased).

    Source Files