pub struct AutoPartitionRule { /* private fields */ }Expand description
AQE rule that adjusts the bucket count of Hash and RoundRobin exchange
nodes based on the observed data volume from the previous execution.
The rule reads RuntimeStats (one per DataFusion partition), sums
memory_bytes to obtain the total stage output size, and computes a target
partition count:
target = clamp(1, max_buckets, ceil(total_bytes / target_partition_bytes))
The target is applied unconditionally: the rule can both increase and decrease bucket counts. This matches Spark AQE’s behavior — if early execution stages produced far less data than expected, the rule shrinks the downstream partition count to avoid over-parallelism (task scheduling overhead dominating actual work). The minimum floor is always 1.
When stats are empty (first execution) or contain no measurable memory, the
rule is a no-op and returns None.
Implementations§
Trait Implementations§
Source§impl AqeRule for AutoPartitionRule
impl AqeRule for AutoPartitionRule
Source§fn apply(
&self,
plan: &PhysicalPlan,
stats: &[RuntimeStats],
) -> Option<PhysicalPlan>
fn apply( &self, plan: &PhysicalPlan, stats: &[RuntimeStats], ) -> Option<PhysicalPlan>
RuntimeStats for each stage. Read moreAuto Trait Implementations§
impl Freeze for AutoPartitionRule
impl RefUnwindSafe for AutoPartitionRule
impl Send for AutoPartitionRule
impl Sync for AutoPartitionRule
impl Unpin for AutoPartitionRule
impl UnsafeUnpin for AutoPartitionRule
impl UnwindSafe for AutoPartitionRule
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request