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_batchand use the default implementation ofto_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 implementto_batchwithto_batch_with_order_required(&Order::any()).
Required Methods§
Sourcefn to_batch(&self) -> Result<BatchPlanRef>
fn to_batch(&self) -> Result<BatchPlanRef>
to_batch is equivalent to to_batch_with_order_required(&Order::any())
Provided Methods§
Sourcefn to_batch_with_order_required(
&self,
required_order: &Order,
) -> Result<BatchPlanRef>
fn to_batch_with_order_required( &self, required_order: &Order, ) -> Result<BatchPlanRef>
convert the plan to batch physical plan and satisfy the required Order