pub struct StatisticsRegistry { /* private fields */ }Expand description
Registry that chains StatisticsProvider implementations.
The registry is a stateless provider chain: it holds no mutable state
and is cheaply Cloneable / Send / Sync.
Implementations§
Source§impl StatisticsRegistry
impl StatisticsRegistry
Sourcepub fn new() -> StatisticsRegistry
pub fn new() -> StatisticsRegistry
Create a new empty registry.
With no providers, compute() falls back to each plan node’s
built-in partition_statistics(). Register providers to enhance
statistics (e.g., inject NDV, use histograms).
Sourcepub fn with_providers(
providers: Vec<Arc<dyn StatisticsProvider>>,
) -> StatisticsRegistry
pub fn with_providers( providers: Vec<Arc<dyn StatisticsProvider>>, ) -> StatisticsRegistry
Create a registry with the given provider chain.
Sourcepub fn default_with_builtin_providers() -> StatisticsRegistry
pub fn default_with_builtin_providers() -> StatisticsRegistry
Create a registry pre-loaded with the standard built-in providers.
Provider order (first match wins):
Sourcepub fn register(&mut self, provider: Arc<dyn StatisticsProvider>)
pub fn register(&mut self, provider: Arc<dyn StatisticsProvider>)
Register a provider at the front of the chain (higher priority).
Sourcepub fn providers(&self) -> &[Arc<dyn StatisticsProvider>]
pub fn providers(&self) -> &[Arc<dyn StatisticsProvider>]
Returns the current provider chain.
Sourcepub fn compute(
&self,
plan: &(dyn ExecutionPlan + 'static),
) -> Result<ExtendedStatistics, DataFusionError>
pub fn compute( &self, plan: &(dyn ExecutionPlan + 'static), ) -> Result<ExtendedStatistics, DataFusionError>
Compute extended statistics for a plan through the provider chain.
Performs a bottom-up tree walk: child statistics are computed recursively
and passed to providers, mirroring how partition_statistics composes
operators. Once #20184
lands, the registry can feed enriched base stats directly into
partition_statistics(child_stats), removing the need for a separate walk.
If no providers are registered, falls back to the plan’s built-in
partition_statistics(None) with no overhead.
Sourcepub fn compute_base(
&self,
plan: &(dyn ExecutionPlan + 'static),
) -> Result<Statistics, DataFusionError>
pub fn compute_base( &self, plan: &(dyn ExecutionPlan + 'static), ) -> Result<Statistics, DataFusionError>
Compute statistics and return only the base Statistics (no extensions).
Convenience method for callers that don’t need extensions.
Trait Implementations§
Source§impl Clone for StatisticsRegistry
impl Clone for StatisticsRegistry
Source§fn clone(&self) -> StatisticsRegistry
fn clone(&self) -> StatisticsRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StatisticsRegistry
impl Debug for StatisticsRegistry
Source§impl Default for StatisticsRegistry
impl Default for StatisticsRegistry
Source§fn default() -> StatisticsRegistry
fn default() -> StatisticsRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for StatisticsRegistry
impl !UnwindSafe for StatisticsRegistry
impl Freeze for StatisticsRegistry
impl Send for StatisticsRegistry
impl Sync for StatisticsRegistry
impl Unpin for StatisticsRegistry
impl UnsafeUnpin for StatisticsRegistry
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more