pub trait ToDistributedBatch {
// Required method
fn to_distributed(&self) -> Result<PlanRef, RwError>;
// Provided method
fn to_distributed_with_required(
&self,
required_order: &Order,
required_dist: &RequiredDist,
) -> Result<PlanRef, RwError> { ... }
}
Expand description
ToDistributedBatch
allows to convert a batch physical plan to distributed batch plan, by
insert exchange node, with an optional required order and distributed.
To implement this trait you can choose one of the two ways:
- Implement
to_distributed
and use the default implementation ofto_distributed_with_required
- Or, if a better plan can be generated when a required order is given, you can implement
to_distributed_with_required
, and implementto_distributed
withto_distributed_with_required(&Order::any(), &RequiredDist::Any)
Required Methods§
sourcefn to_distributed(&self) -> Result<PlanRef, RwError>
fn to_distributed(&self) -> Result<PlanRef, RwError>
to_distributed
is equivalent to to_distributed_with_required(&Order::any(), &RequiredDist::Any)
Provided Methods§
sourcefn to_distributed_with_required(
&self,
required_order: &Order,
required_dist: &RequiredDist,
) -> Result<PlanRef, RwError>
fn to_distributed_with_required( &self, required_order: &Order, required_dist: &RequiredDist, ) -> Result<PlanRef, RwError>
insert the exchange in batch physical plan to satisfy the required Distribution and Order.