diff --git a/datafusion-examples/examples/execution_monitoring/memory_pool_execution_plan.rs b/datafusion-examples/examples/execution_monitoring/memory_pool_execution_plan.rs index 48475acbb1542..e51ba46a33135 100644 --- a/datafusion-examples/examples/execution_monitoring/memory_pool_execution_plan.rs +++ b/datafusion-examples/examples/execution_monitoring/memory_pool_execution_plan.rs @@ -38,7 +38,7 @@ use datafusion::execution::{SendableRecordBatchStream, TaskContext}; use datafusion::logical_expr::LogicalPlanBuilder; use datafusion::physical_plan::stream::RecordBatchStreamAdapter; use datafusion::physical_plan::{ - DisplayAs, DisplayFormatType, ExecutionPlan, PlanProperties, Statistics, + DisplayAs, DisplayFormatType, ExecutionPlan, PlanProperties, }; use datafusion::prelude::*; use futures::stream::{StreamExt, TryStreamExt}; @@ -296,8 +296,4 @@ impl ExecutionPlan for BufferingExecutionPlan { }), ))) } - - fn statistics(&self) -> Result { - Ok(Statistics::new_unknown(&self.schema)) - } } diff --git a/datafusion/core/tests/custom_sources_cases/mod.rs b/datafusion/core/tests/custom_sources_cases/mod.rs index 8453615c2886b..ec0b9e253d2ab 100644 --- a/datafusion/core/tests/custom_sources_cases/mod.rs +++ b/datafusion/core/tests/custom_sources_cases/mod.rs @@ -180,10 +180,6 @@ impl ExecutionPlan for CustomExecutionPlan { Ok(Box::pin(TestCustomRecordBatchStream { nb_batch: 1 })) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { return Ok(Statistics::new_unknown(&self.schema())); diff --git a/datafusion/core/tests/custom_sources_cases/provider_filter_pushdown.rs b/datafusion/core/tests/custom_sources_cases/provider_filter_pushdown.rs index ca1eaa1f958ea..b54a57b033591 100644 --- a/datafusion/core/tests/custom_sources_cases/provider_filter_pushdown.rs +++ b/datafusion/core/tests/custom_sources_cases/provider_filter_pushdown.rs @@ -29,7 +29,7 @@ use datafusion::logical_expr::TableProviderFilterPushDown; use datafusion::physical_plan::stream::RecordBatchStreamAdapter; use datafusion::physical_plan::{ DisplayAs, DisplayFormatType, ExecutionPlan, Partitioning, PlanProperties, - SendableRecordBatchStream, Statistics, + SendableRecordBatchStream, }; use datafusion::prelude::*; use datafusion::scalar::ScalarValue; @@ -149,12 +149,6 @@ impl ExecutionPlan for CustomPlan { })), ))) } - - fn statistics(&self) -> Result { - // here we could provide more accurate statistics - // but we want to test the filter pushdown not the CBOs - Ok(Statistics::new_unknown(&self.schema())) - } } #[derive(Clone, Debug)] diff --git a/datafusion/core/tests/custom_sources_cases/statistics.rs b/datafusion/core/tests/custom_sources_cases/statistics.rs index 820c2a470b376..e81cd9f6b81b1 100644 --- a/datafusion/core/tests/custom_sources_cases/statistics.rs +++ b/datafusion/core/tests/custom_sources_cases/statistics.rs @@ -181,10 +181,6 @@ impl ExecutionPlan for StatisticsValidation { unimplemented!("This plan only serves for testing statistics") } - fn statistics(&self) -> Result { - Ok(self.stats.clone()) - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { Ok(Statistics::new_unknown(&self.schema)) diff --git a/datafusion/core/tests/physical_optimizer/enforce_distribution.rs b/datafusion/core/tests/physical_optimizer/enforce_distribution.rs index 94ae82a9ad755..30edd7196606e 100644 --- a/datafusion/core/tests/physical_optimizer/enforce_distribution.rs +++ b/datafusion/core/tests/physical_optimizer/enforce_distribution.rs @@ -67,8 +67,7 @@ use datafusion_physical_plan::projection::{ProjectionExec, ProjectionExpr}; use datafusion_physical_plan::sorts::sort_preserving_merge::SortPreservingMergeExec; use datafusion_physical_plan::union::UnionExec; use datafusion_physical_plan::{ - DisplayAs, DisplayFormatType, ExecutionPlanProperties, PlanProperties, Statistics, - displayable, + DisplayAs, DisplayFormatType, ExecutionPlanProperties, PlanProperties, displayable, }; use insta::Settings; @@ -210,10 +209,6 @@ impl ExecutionPlan for SortRequiredExec { ) -> Result { unreachable!(); } - - fn statistics(&self) -> Result { - self.input.partition_statistics(None) - } } fn parquet_exec() -> Arc { diff --git a/datafusion/core/tests/physical_optimizer/join_selection.rs b/datafusion/core/tests/physical_optimizer/join_selection.rs index b640159ca8463..567af64c6a366 100644 --- a/datafusion/core/tests/physical_optimizer/join_selection.rs +++ b/datafusion/core/tests/physical_optimizer/join_selection.rs @@ -1176,10 +1176,6 @@ impl ExecutionPlan for StatisticsExec { unimplemented!("This plan only serves for testing statistics") } - fn statistics(&self) -> Result { - Ok(self.stats.clone()) - } - fn partition_statistics(&self, partition: Option) -> Result { Ok(if partition.is_some() { Statistics::new_unknown(&self.schema) diff --git a/datafusion/core/tests/user_defined/user_defined_plan.rs b/datafusion/core/tests/user_defined/user_defined_plan.rs index d53e076739608..990b05c49d82b 100644 --- a/datafusion/core/tests/user_defined/user_defined_plan.rs +++ b/datafusion/core/tests/user_defined/user_defined_plan.rs @@ -84,7 +84,7 @@ use datafusion::{ physical_expr::EquivalenceProperties, physical_plan::{ DisplayAs, DisplayFormatType, Distribution, ExecutionPlan, Partitioning, - PlanProperties, RecordBatchStream, SendableRecordBatchStream, Statistics, + PlanProperties, RecordBatchStream, SendableRecordBatchStream, }, physical_planner::{DefaultPhysicalPlanner, ExtensionPlanner, PhysicalPlanner}, prelude::{SessionConfig, SessionContext}, @@ -742,12 +742,6 @@ impl ExecutionPlan for TopKExec { state: BTreeMap::new(), })) } - - fn statistics(&self) -> Result { - // to improve the optimizability of this plan - // better statistics inference could be provided - Ok(Statistics::new_unknown(&self.schema())) - } } // A very specialized TopK implementation diff --git a/datafusion/datasource/src/source.rs b/datafusion/datasource/src/source.rs index 71ddac84a8f08..a4e27dac769af 100644 --- a/datafusion/datasource/src/source.rs +++ b/datafusion/datasource/src/source.rs @@ -158,16 +158,6 @@ pub trait DataSource: Send + Sync + Debug { /// across all partitions if `partition` is `None`. fn partition_statistics(&self, partition: Option) -> Result; - /// Returns aggregate statistics across all partitions. - /// - /// # Deprecated - /// Use [`Self::partition_statistics`] instead, which provides more fine-grained - /// control over statistics retrieval (per-partition or aggregate). - #[deprecated(since = "51.0.0", note = "Use partition_statistics instead")] - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - /// Return a copy of this DataSource with a new fetch limit fn with_fetch(&self, _limit: Option) -> Option>; fn fetch(&self) -> Option; diff --git a/datafusion/ffi/src/execution_plan.rs b/datafusion/ffi/src/execution_plan.rs index c879b022067c3..94e1d03d0832c 100644 --- a/datafusion/ffi/src/execution_plan.rs +++ b/datafusion/ffi/src/execution_plan.rs @@ -367,10 +367,6 @@ pub(crate) mod tests { ) -> Result { unimplemented!() } - - fn statistics(&self) -> Result { - unimplemented!() - } } #[test] diff --git a/datafusion/physical-optimizer/src/output_requirements.rs b/datafusion/physical-optimizer/src/output_requirements.rs index 0dc6a25fbc0b7..afc0ee1a336dd 100644 --- a/datafusion/physical-optimizer/src/output_requirements.rs +++ b/datafusion/physical-optimizer/src/output_requirements.rs @@ -244,10 +244,6 @@ impl ExecutionPlan for OutputRequirementExec { unreachable!(); } - fn statistics(&self) -> Result { - self.input.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { self.input.partition_statistics(partition) } diff --git a/datafusion/physical-plan/src/aggregates/mod.rs b/datafusion/physical-plan/src/aggregates/mod.rs index 6cd8557421e5d..27eee0025aa60 100644 --- a/datafusion/physical-plan/src/aggregates/mod.rs +++ b/datafusion/physical-plan/src/aggregates/mod.rs @@ -1403,10 +1403,6 @@ impl ExecutionPlan for AggregateExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { let child_statistics = self.input().partition_statistics(partition)?; self.statistics_inner(&child_statistics) @@ -2487,10 +2483,6 @@ mod tests { Ok(Box::pin(stream)) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { return Ok(Statistics::new_unknown(self.schema().as_ref())); diff --git a/datafusion/physical-plan/src/coalesce_batches.rs b/datafusion/physical-plan/src/coalesce_batches.rs index dfcd3cb0bcae7..1356eca78329d 100644 --- a/datafusion/physical-plan/src/coalesce_batches.rs +++ b/datafusion/physical-plan/src/coalesce_batches.rs @@ -206,10 +206,6 @@ impl ExecutionPlan for CoalesceBatchesExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { self.input .partition_statistics(partition)? diff --git a/datafusion/physical-plan/src/coalesce_partitions.rs b/datafusion/physical-plan/src/coalesce_partitions.rs index 22dcc85d6ea3a..d1fc58837b0fa 100644 --- a/datafusion/physical-plan/src/coalesce_partitions.rs +++ b/datafusion/physical-plan/src/coalesce_partitions.rs @@ -224,10 +224,6 @@ impl ExecutionPlan for CoalescePartitionsExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, _partition: Option) -> Result { self.input .partition_statistics(None)? diff --git a/datafusion/physical-plan/src/display.rs b/datafusion/physical-plan/src/display.rs index 52c37a106b39e..19698cd4ea78c 100644 --- a/datafusion/physical-plan/src/display.rs +++ b/datafusion/physical-plan/src/display.rs @@ -1176,10 +1176,6 @@ mod tests { todo!() } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { return Ok(Statistics::new_unknown(self.schema().as_ref())); diff --git a/datafusion/physical-plan/src/empty.rs b/datafusion/physical-plan/src/empty.rs index 43f12469dbf0c..64808bbc25167 100644 --- a/datafusion/physical-plan/src/empty.rs +++ b/datafusion/physical-plan/src/empty.rs @@ -156,10 +156,6 @@ impl ExecutionPlan for EmptyExec { )?)) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if let Some(partition) = partition { assert_or_internal_err!( diff --git a/datafusion/physical-plan/src/execution_plan.rs b/datafusion/physical-plan/src/execution_plan.rs index 43cce0e5ea421..2ce1e79601c52 100644 --- a/datafusion/physical-plan/src/execution_plan.rs +++ b/datafusion/physical-plan/src/execution_plan.rs @@ -472,17 +472,6 @@ pub trait ExecutionPlan: Debug + DisplayAs + Send + Sync { None } - /// Returns statistics for this `ExecutionPlan` node. If statistics are not - /// available, should return [`Statistics::new_unknown`] (the default), not - /// an error. - /// - /// For TableScan executors, which supports filter pushdown, special attention - /// needs to be paid to whether the stats returned by this method are exact or not - #[deprecated(since = "48.0.0", note = "Use `partition_statistics` method instead")] - fn statistics(&self) -> Result { - Ok(Statistics::new_unknown(&self.schema())) - } - /// Returns statistics for a specific partition of this `ExecutionPlan` node. /// If statistics are not available, should return [`Statistics::new_unknown`] /// (the default), not an error. @@ -1508,10 +1497,6 @@ mod tests { unimplemented!() } - fn statistics(&self) -> Result { - unimplemented!() - } - fn partition_statistics(&self, _partition: Option) -> Result { unimplemented!() } @@ -1575,10 +1560,6 @@ mod tests { unimplemented!() } - fn statistics(&self) -> Result { - unimplemented!() - } - fn partition_statistics(&self, _partition: Option) -> Result { unimplemented!() } diff --git a/datafusion/physical-plan/src/filter.rs b/datafusion/physical-plan/src/filter.rs index 13ba05f36ec9a..2af0731fb7a63 100644 --- a/datafusion/physical-plan/src/filter.rs +++ b/datafusion/physical-plan/src/filter.rs @@ -542,10 +542,6 @@ impl ExecutionPlan for FilterExec { /// The output statistics of a filtering operation can be estimated if the /// predicate's selectivity value can be determined for the incoming data. - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { let input_stats = self.input.partition_statistics(partition)?; let stats = Self::statistics_helper( diff --git a/datafusion/physical-plan/src/joins/cross_join.rs b/datafusion/physical-plan/src/joins/cross_join.rs index 7ada14be66543..d5b540885efae 100644 --- a/datafusion/physical-plan/src/joins/cross_join.rs +++ b/datafusion/physical-plan/src/joins/cross_join.rs @@ -356,10 +356,6 @@ impl ExecutionPlan for CrossJoinExec { } } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { // Get the all partitions statistics of the left let left_stats = self.left.partition_statistics(None)?; diff --git a/datafusion/physical-plan/src/joins/hash_join/exec.rs b/datafusion/physical-plan/src/joins/hash_join/exec.rs index 6b18b56413b71..77d736e938182 100644 --- a/datafusion/physical-plan/src/joins/hash_join/exec.rs +++ b/datafusion/physical-plan/src/joins/hash_join/exec.rs @@ -1336,10 +1336,6 @@ impl ExecutionPlan for HashJoinExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { return Ok(Statistics::new_unknown(&self.schema())); diff --git a/datafusion/physical-plan/src/joins/nested_loop_join.rs b/datafusion/physical-plan/src/joins/nested_loop_join.rs index e6bc26c34cb44..5b2cebb360439 100644 --- a/datafusion/physical-plan/src/joins/nested_loop_join.rs +++ b/datafusion/physical-plan/src/joins/nested_loop_join.rs @@ -611,10 +611,6 @@ impl ExecutionPlan for NestedLoopJoinExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { // NestedLoopJoinExec is designed for joins without equijoin keys in the // ON clause (e.g., `t1 JOIN t2 ON (t1.v1 + t2.v1) % 2 = 0`). Any join diff --git a/datafusion/physical-plan/src/joins/sort_merge_join/exec.rs b/datafusion/physical-plan/src/joins/sort_merge_join/exec.rs index ae7a5fa764bcc..8778e4154e60e 100644 --- a/datafusion/physical-plan/src/joins/sort_merge_join/exec.rs +++ b/datafusion/physical-plan/src/joins/sort_merge_join/exec.rs @@ -519,10 +519,6 @@ impl ExecutionPlan for SortMergeJoinExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { // SortMergeJoinExec uses symmetric hash partitioning where both left and right // inputs are hash-partitioned on the join keys. This means partition `i` of the diff --git a/datafusion/physical-plan/src/joins/symmetric_hash_join.rs b/datafusion/physical-plan/src/joins/symmetric_hash_join.rs index 1f6bc703a0300..4fdc5fc64dc67 100644 --- a/datafusion/physical-plan/src/joins/symmetric_hash_join.rs +++ b/datafusion/physical-plan/src/joins/symmetric_hash_join.rs @@ -52,7 +52,7 @@ use crate::projection::{ }; use crate::{ DisplayAs, DisplayFormatType, Distribution, ExecutionPlan, ExecutionPlanProperties, - PlanProperties, RecordBatchStream, SendableRecordBatchStream, Statistics, + PlanProperties, RecordBatchStream, SendableRecordBatchStream, joins::StreamJoinPartitionMode, metrics::{ExecutionPlanMetricsSet, MetricsSet}, }; @@ -470,11 +470,6 @@ impl ExecutionPlan for SymmetricHashJoinExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - // TODO stats: it is not possible in general to know the output size of joins - Ok(Statistics::new_unknown(&self.schema())) - } - fn execute( &self, partition: usize, diff --git a/datafusion/physical-plan/src/limit.rs b/datafusion/physical-plan/src/limit.rs index fea7acb221304..9ce63a1c586a6 100644 --- a/datafusion/physical-plan/src/limit.rs +++ b/datafusion/physical-plan/src/limit.rs @@ -209,10 +209,6 @@ impl ExecutionPlan for GlobalLimitExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { self.input .partition_statistics(partition)? @@ -369,10 +365,6 @@ impl ExecutionPlan for LocalLimitExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { self.input .partition_statistics(partition)? diff --git a/datafusion/physical-plan/src/memory.rs b/datafusion/physical-plan/src/memory.rs index 4a406ca648d57..a58abe20a23ee 100644 --- a/datafusion/physical-plan/src/memory.rs +++ b/datafusion/physical-plan/src/memory.rs @@ -27,7 +27,7 @@ use crate::execution_plan::{Boundedness, EmissionType, SchedulingType}; use crate::metrics::{BaselineMetrics, ExecutionPlanMetricsSet, MetricsSet}; use crate::{ DisplayAs, DisplayFormatType, ExecutionPlan, Partitioning, PlanProperties, - RecordBatchStream, SendableRecordBatchStream, Statistics, + RecordBatchStream, SendableRecordBatchStream, }; use arrow::array::RecordBatch; @@ -352,10 +352,6 @@ impl ExecutionPlan for LazyMemoryExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - Ok(Statistics::new_unknown(&self.schema)) - } - fn reset_state(self: Arc) -> Result> { let generators = self .generators() diff --git a/datafusion/physical-plan/src/placeholder_row.rs b/datafusion/physical-plan/src/placeholder_row.rs index 4d00b73cff39c..c91085965b07c 100644 --- a/datafusion/physical-plan/src/placeholder_row.rs +++ b/datafusion/physical-plan/src/placeholder_row.rs @@ -169,10 +169,6 @@ impl ExecutionPlan for PlaceholderRowExec { Ok(Box::pin(cooperative(ms))) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { let batches = self .data() diff --git a/datafusion/physical-plan/src/projection.rs b/datafusion/physical-plan/src/projection.rs index 76711a8f835f4..3e77de2125bcd 100644 --- a/datafusion/physical-plan/src/projection.rs +++ b/datafusion/physical-plan/src/projection.rs @@ -342,10 +342,6 @@ impl ExecutionPlan for ProjectionExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { let input_stats = self.input.partition_statistics(partition)?; let output_schema = self.schema(); diff --git a/datafusion/physical-plan/src/recursive_query.rs b/datafusion/physical-plan/src/recursive_query.rs index 936a02581e89c..f2cba13717acc 100644 --- a/datafusion/physical-plan/src/recursive_query.rs +++ b/datafusion/physical-plan/src/recursive_query.rs @@ -30,7 +30,7 @@ use crate::metrics::{ }; use crate::{ DisplayAs, DisplayFormatType, ExecutionPlan, PlanProperties, RecordBatchStream, - SendableRecordBatchStream, Statistics, + SendableRecordBatchStream, }; use arrow::array::{BooleanArray, BooleanBuilder}; use arrow::compute::filter_record_batch; @@ -208,10 +208,6 @@ impl ExecutionPlan for RecursiveQueryExec { fn metrics(&self) -> Option { Some(self.metrics.clone_inner()) } - - fn statistics(&self) -> Result { - Ok(Statistics::new_unknown(&self.schema())) - } } impl DisplayAs for RecursiveQueryExec { diff --git a/datafusion/physical-plan/src/repartition/mod.rs b/datafusion/physical-plan/src/repartition/mod.rs index 612c7bb27ddf4..2b0c0ea31689b 100644 --- a/datafusion/physical-plan/src/repartition/mod.rs +++ b/datafusion/physical-plan/src/repartition/mod.rs @@ -1070,10 +1070,6 @@ impl ExecutionPlan for RepartitionExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.input.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if let Some(partition) = partition { let partition_count = self.partitioning().partition_count(); diff --git a/datafusion/physical-plan/src/sorts/partial_sort.rs b/datafusion/physical-plan/src/sorts/partial_sort.rs index 73ba889c9e40b..08bc73c92d4b3 100644 --- a/datafusion/physical-plan/src/sorts/partial_sort.rs +++ b/datafusion/physical-plan/src/sorts/partial_sort.rs @@ -329,10 +329,6 @@ impl ExecutionPlan for PartialSortExec { Some(self.metrics_set.clone_inner()) } - fn statistics(&self) -> Result { - self.input.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { self.input.partition_statistics(partition) } diff --git a/datafusion/physical-plan/src/sorts/sort.rs b/datafusion/physical-plan/src/sorts/sort.rs index a8361f7b2941e..f96e9a0d72c4c 100644 --- a/datafusion/physical-plan/src/sorts/sort.rs +++ b/datafusion/physical-plan/src/sorts/sort.rs @@ -1352,10 +1352,6 @@ impl ExecutionPlan for SortExec { Some(self.metrics_set.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if !self.preserve_partitioning() { return self diff --git a/datafusion/physical-plan/src/sorts/sort_preserving_merge.rs b/datafusion/physical-plan/src/sorts/sort_preserving_merge.rs index 68c457a0d8a3c..6c1bb4883d1ad 100644 --- a/datafusion/physical-plan/src/sorts/sort_preserving_merge.rs +++ b/datafusion/physical-plan/src/sorts/sort_preserving_merge.rs @@ -372,10 +372,6 @@ impl ExecutionPlan for SortPreservingMergeExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.input.partition_statistics(None) - } - fn partition_statistics(&self, _partition: Option) -> Result { self.input.partition_statistics(None) } diff --git a/datafusion/physical-plan/src/test.rs b/datafusion/physical-plan/src/test.rs index c6d0940c35480..a967d035bd387 100644 --- a/datafusion/physical-plan/src/test.rs +++ b/datafusion/physical-plan/src/test.rs @@ -169,10 +169,6 @@ impl ExecutionPlan for TestMemoryExec { unimplemented!() } - fn statistics(&self) -> Result { - self.statistics_inner() - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { Ok(Statistics::new_unknown(&self.schema)) diff --git a/datafusion/physical-plan/src/test/exec.rs b/datafusion/physical-plan/src/test/exec.rs index 4507cccba05a9..ebed84477a568 100644 --- a/datafusion/physical-plan/src/test/exec.rs +++ b/datafusion/physical-plan/src/test/exec.rs @@ -254,10 +254,6 @@ impl ExecutionPlan for MockExec { } // Panics if one of the batches is an error - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { return Ok(Statistics::new_unknown(&self.schema)); @@ -410,10 +406,6 @@ impl ExecutionPlan for BarrierExec { Ok(builder.build()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if partition.is_some() { return Ok(Statistics::new_unknown(&self.schema)); @@ -600,10 +592,6 @@ impl ExecutionPlan for StatisticsExec { unimplemented!("This plan only serves for testing statistics") } - fn statistics(&self) -> Result { - Ok(self.stats.clone()) - } - fn partition_statistics(&self, partition: Option) -> Result { Ok(if partition.is_some() { Statistics::new_unknown(&self.schema) diff --git a/datafusion/physical-plan/src/union.rs b/datafusion/physical-plan/src/union.rs index 4ebb8910faea1..8174160dc9332 100644 --- a/datafusion/physical-plan/src/union.rs +++ b/datafusion/physical-plan/src/union.rs @@ -310,10 +310,6 @@ impl ExecutionPlan for UnionExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { if let Some(partition_idx) = partition { // For a specific partition, find which input it belongs to @@ -628,10 +624,6 @@ impl ExecutionPlan for InterleaveExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { let stats = self .inputs diff --git a/datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs b/datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs index 987a400ec369e..20d54303a94b4 100644 --- a/datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs +++ b/datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs @@ -368,10 +368,6 @@ impl ExecutionPlan for BoundedWindowAggExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { let input_stat = self.input.partition_statistics(partition)?; self.statistics_helper(input_stat) diff --git a/datafusion/physical-plan/src/windows/window_agg_exec.rs b/datafusion/physical-plan/src/windows/window_agg_exec.rs index aa99f4f49885a..0c73cf23523d5 100644 --- a/datafusion/physical-plan/src/windows/window_agg_exec.rs +++ b/datafusion/physical-plan/src/windows/window_agg_exec.rs @@ -272,10 +272,6 @@ impl ExecutionPlan for WindowAggExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - self.partition_statistics(None) - } - fn partition_statistics(&self, partition: Option) -> Result { let input_stat = self.input.partition_statistics(partition)?; let win_cols = self.window_expr.len(); diff --git a/datafusion/physical-plan/src/work_table.rs b/datafusion/physical-plan/src/work_table.rs index 1313909adbba2..08390f87a2033 100644 --- a/datafusion/physical-plan/src/work_table.rs +++ b/datafusion/physical-plan/src/work_table.rs @@ -231,10 +231,6 @@ impl ExecutionPlan for WorkTableExec { Some(self.metrics.clone_inner()) } - fn statistics(&self) -> Result { - Ok(Statistics::new_unknown(&self.schema())) - } - fn partition_statistics(&self, _partition: Option) -> Result { Ok(Statistics::new_unknown(&self.schema())) }