Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions datafusion/common/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
// specific language governing permissions and limitations
// under the License.

//! This module provides an interface for plan level statistics.
//! This module provides data structures to represent statistics

use crate::ScalarValue;

/// Statistics for a physical plan node
/// Statistics for a relation
/// Fields are optional and can be inexact because the sources
/// sometimes provide approximate estimates for performance reasons
/// and the transformations output are not always predictable.
Expand All @@ -37,7 +37,7 @@ pub struct Statistics {
pub is_exact: bool,
}

/// This table statistics are estimates about column
/// Statistics for a column within a relation
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct ColumnStatistics {
/// Number of null values on column
Expand Down
6 changes: 6 additions & 0 deletions datafusion/core/src/datasource/datasource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::any::Any;
use std::sync::Arc;

use async_trait::async_trait;
use datafusion_common::Statistics;
use datafusion_expr::LogicalPlan;
pub use datafusion_expr::{TableProviderFilterPushDown, TableType};

Expand Down Expand Up @@ -77,6 +78,11 @@ pub trait TableProvider: Sync + Send {
) -> Result<TableProviderFilterPushDown> {
Ok(TableProviderFilterPushDown::Unsupported)
}

/// Get statistics for this table, if available
fn statistics(&self) -> Option<Statistics> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if any of the built in providers can give statistic (I am thinking Parquet) 🤔

Definitely something for a follow on PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Filed as #3988

None
}
}

/// A factory which creates [`TableProvider`]s at runtime given a URL.
Expand Down