pub struct SpillableJoinSelection { /* private fields */ }Expand description
Convert hash joins whose estimated build side cannot fit the per-task memory share into sort-merge joins, which can spill.
Implementations§
Source§impl SpillableJoinSelection
impl SpillableJoinSelection
Sourcepub fn from_capacity() -> Self
pub fn from_capacity() -> Self
Derive the threshold from the process’s capacity decision, honouring
SPILL_JOIN_BUILD_BYTES_ENV.
Sourcepub fn without_broadcast_rescue(self) -> Self
pub fn without_broadcast_rescue(self) -> Self
Forbid the degenerate-broadcast rescue — for a plan that is about to be cut into stages, where an added exchange is an added stage boundary.
Sourcepub fn for_local_execution() -> Self
pub fn for_local_execution() -> Self
Same threshold as Self::from_capacity, but allowed to choose the
grace hash join.
Only for plans that are already decoded and will not be serialized —
see distributed_plan::apply_local_spill_strategy.
Sourcepub fn with_grace_where_plans_are_never_encoded(self) -> Self
pub fn with_grace_where_plans_are_never_encoded(self) -> Self
Allow grace only in a process that never encodes a stage plan.
with_krishiv_optimizer_rules is shared by two callers with opposite
requirements: the coordinator’s staging planner, whose output must
survive datafusion-proto (a GraceHashJoinExec there fails to encode
and the scheduler’s response is to run the whole query as a SINGLE
TASK), and the one-shot CLI, whose plans never leave the process.
is_single_query_process() separates them exactly: stage building
happens only in build_stages_for_parquet_tables, reached solely from
krishiv-scheduler’s distributed_batch, i.e. the coordinator daemon,
which never declares itself single-query. It is also the same predicate
that gates rescue_degenerate_broadcast, which is the point: the rescue
exists to make a degenerate broadcast spillable, and grace is the better
way to spill one. Enabling them apart is what left the rescue handing
every join to sort-merge while grace sat unreachable.
This does not turn grace on — grace_hash_join::enabled() still
defaults off. It stops KRISHIV_GRACE_HASH_JOIN from being silently
inert in the tier that has the rescue.
Sourcepub fn with_threshold(threshold_bytes: Option<u64>) -> Self
pub fn with_threshold(threshold_bytes: Option<u64>) -> Self
Explicit threshold, for tests. Keeps the sort-merge conversion.
Sourcepub fn with_threshold_and_grace(
threshold_bytes: Option<u64>,
grace: bool,
) -> Self
pub fn with_threshold_and_grace( threshold_bytes: Option<u64>, grace: bool, ) -> Self
Explicit threshold and algorithm, for tests.
Trait Implementations§
Source§impl Debug for SpillableJoinSelection
impl Debug for SpillableJoinSelection
Source§impl PhysicalOptimizerRule for SpillableJoinSelection
impl PhysicalOptimizerRule for SpillableJoinSelection
Source§fn schema_check(&self) -> bool
fn schema_check(&self) -> bool
Source§fn optimize(
&self,
plan: Arc<dyn ExecutionPlan>,
config: &ConfigOptions,
) -> Result<Arc<dyn ExecutionPlan>>
fn optimize( &self, plan: Arc<dyn ExecutionPlan>, config: &ConfigOptions, ) -> Result<Arc<dyn ExecutionPlan>>
plan to an optimized form. Read moreSource§fn optimize_with_context(
&self,
plan: Arc<dyn ExecutionPlan>,
context: &dyn PhysicalOptimizerContext,
) -> Result<Arc<dyn ExecutionPlan>, DataFusionError>
fn optimize_with_context( &self, plan: Arc<dyn ExecutionPlan>, context: &dyn PhysicalOptimizerContext, ) -> Result<Arc<dyn ExecutionPlan>, DataFusionError>
plan with access to extended context (statistics registry, etc.). Read moreAuto Trait Implementations§
impl Freeze for SpillableJoinSelection
impl RefUnwindSafe for SpillableJoinSelection
impl Send for SpillableJoinSelection
impl Sync for SpillableJoinSelection
impl Unpin for SpillableJoinSelection
impl UnsafeUnpin for SpillableJoinSelection
impl UnwindSafe for SpillableJoinSelection
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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