Type Alias LogicalPlanRoot

Source
pub type LogicalPlanRoot = PlanRoot<PlanPhaseLogical>;

Aliased Type§

pub struct LogicalPlanRoot {
    pub plan: PlanRef,
    _phase: PhantomData<PlanPhaseLogical>,
    required_dist: RequiredDist,
    required_order: Order,
    out_fields: FixedBitSet,
    out_names: Vec<String>,
}

Fields§

§plan: PlanRef§_phase: PhantomData<PlanPhaseLogical>§required_dist: RequiredDist§required_order: Order§out_fields: FixedBitSet§out_names: Vec<String>

Implementations§

Source§

impl LogicalPlanRoot

Source

pub fn new_with_logical_plan( plan: PlanRef, required_dist: RequiredDist, required_order: Order, out_fields: FixedBitSet, out_names: Vec<String>, ) -> Self

Source§

impl LogicalPlanRoot

Source

pub fn into_unordered_subplan(self) -> PlanRef

Transform the PlanRoot back to a PlanRef suitable to be used as a subplan, for example as insert source or subquery. This ignores Order but retains post-Order pruning (out_fields).

Source

pub fn into_array_agg(self) -> Result<PlanRef, RwError>

Transform the PlanRoot wrapped in an array-construction subquery to a PlanRef supported by ARRAY_AGG. Similar to the unordered version, this abstracts away internal self.plan which is further modified by self.required_order then self.out_fields.

Source

pub fn gen_optimized_logical_plan_for_stream( self, ) -> Result<StreamOptimizedLogicalPlanRoot, RwError>

Apply logical optimization to the plan for stream.

Source

pub fn gen_optimized_logical_plan_for_batch( self, ) -> Result<BatchOptimizedLogicalPlanRoot, RwError>

Apply logical optimization to the plan for batch.

Source

pub fn gen_batch_plan(self) -> Result<BatchPlanRoot, RwError>

Source§

impl LogicalPlanRoot

Source

fn gen_optimized_stream_plan( self, emit_on_window_close: bool, allow_snapshot_backfill: bool, ) -> Result<StreamOptimizedLogicalPlanRoot, RwError>

Generate optimized stream plan

Source

fn gen_optimized_stream_plan_inner( self, emit_on_window_close: bool, stream_scan_type: StreamScanType, ) -> Result<StreamOptimizedLogicalPlanRoot, RwError>

Source

fn gen_stream_plan( self, emit_on_window_close: bool, stream_scan_type: StreamScanType, ) -> Result<StreamOptimizedLogicalPlanRoot, RwError>

Generate create index or create materialize view plan.

Source

fn compute_cardinality(&self) -> Cardinality

Visit the plan root and compute the cardinality.

Panics if not called on a logical plan.

Source

pub fn gen_table_plan( self, context: OptimizerContextRef, table_name: String, database_id: u32, schema_id: u32, _: CreateTableInfo, _: CreateTableProps, ) -> Result<StreamMaterialize, RwError>

Optimize and generate a create table plan.

Source

pub fn gen_materialize_plan( self, database_id: u32, schema_id: u32, mv_name: String, definition: String, emit_on_window_close: bool, ) -> Result<StreamMaterialize, RwError>

Optimize and generate a create materialized view plan.

Source

pub fn gen_index_plan( self, index_name: String, database_id: u32, schema_id: u32, definition: String, retention_seconds: Option<NonZeroU32>, ) -> Result<StreamMaterialize, RwError>

Optimize and generate a create index plan.

Source

pub fn gen_sink_plan( self, sink_name: String, definition: String, properties: WithOptionsSecResolved, emit_on_window_close: bool, db_name: String, sink_from_table_name: String, format_desc: Option<SinkFormatDesc>, without_backfill: bool, target_table: Option<Arc<TableCatalog>>, partition_info: Option<PartitionComputeInfo>, user_specified_columns: bool, ) -> Result<StreamSink, RwError>

Optimize and generate a create sink plan.