pub trait ToBatch {
// Required method
fn to_batch(&self) -> Result<PlanRef, RwError>;
// Provided method
fn to_batch_with_order_required(
&self,
required_order: &Order,
) -> Result<PlanRef, RwError> { ... }
}
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 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_batch
withto_batch_with_order_required(&Order::any())
.