Trait ToBatch

Source
pub trait ToBatch {
    // Required method
    fn to_batch(&self) -> Result<BatchPlanRef>;

    // Provided method
    fn to_batch_with_order_required(
        &self,
        required_order: &Order,
    ) -> Result<BatchPlanRef> { ... }
}
Expand description

ToBatch allows to convert a logical plan node to batch physical node with an optional required order.

The generated plan has single distribution and doesn’t have any exchange nodes inserted. Use either ToLocalBatch or ToDistributedBatch after ToBatch to get a distributed plan.

To implement this trait you can choose one of the two ways:

  • Implement to_batch and use the default implementation of to_batch_with_order_required
  • Or, if a better plan can be generated when a required order is given, you can implement to_batch_with_order_required, and implement to_batch with to_batch_with_order_required(&Order::any()).

Required Methods§

Source

fn to_batch(&self) -> Result<BatchPlanRef>

to_batch is equivalent to to_batch_with_order_required(&Order::any())

Provided Methods§

Source

fn to_batch_with_order_required( &self, required_order: &Order, ) -> Result<BatchPlanRef>

convert the plan to batch physical plan and satisfy the required Order

Implementors§