-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement foundational filter selectivity analysis (#3868)
* Implement foundational filter selectivity analysis * Apply suggestions & minor fixes
- Loading branch information
1 parent
57e445a
commit 6d44791
Showing
10 changed files
with
861 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
//! This module provides an interface for plan level statistics. | ||
use crate::ScalarValue; | ||
|
||
/// Statistics for a physical plan node | ||
/// 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. | ||
#[derive(Debug, Clone, Default, PartialEq, Eq)] | ||
pub struct Statistics { | ||
/// The number of table rows | ||
pub num_rows: Option<usize>, | ||
/// total bytes of the table rows | ||
pub total_byte_size: Option<usize>, | ||
/// Statistics on a column level | ||
pub column_statistics: Option<Vec<ColumnStatistics>>, | ||
/// If true, any field that is `Some(..)` is the actual value in the data provided by the operator (it is not | ||
/// an estimate). Any or all other fields might still be None, in which case no information is known. | ||
/// if false, any field that is `Some(..)` may contain an inexact estimate and may not be the actual value. | ||
pub is_exact: bool, | ||
} | ||
|
||
/// This table statistics are estimates about column | ||
#[derive(Clone, Debug, Default, PartialEq, Eq)] | ||
pub struct ColumnStatistics { | ||
/// Number of null values on column | ||
pub null_count: Option<usize>, | ||
/// Maximum value of column | ||
pub max_value: Option<ScalarValue>, | ||
/// Minimum value of column | ||
pub min_value: Option<ScalarValue>, | ||
/// Number of distinct values | ||
pub distinct_count: Option<usize>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.