Skip to content

Commit

Permalink
Minor: add doc comments to ExtractEquijoinPredicate (#7658)
Browse files Browse the repository at this point in the history
* Minor: add doc comments to `ExtractEquijoinPredicate`

* Update datafusion/optimizer/src/extract_equijoin_predicate.rs

Co-authored-by: Liang-Chi Hsieh <[email protected]>

---------

Co-authored-by: Liang-Chi Hsieh <[email protected]>
  • Loading branch information
alamb and viirya committed Sep 27, 2023
1 parent 32dfbb0 commit bcc2acd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions datafusion/optimizer/src/extract_equijoin_predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//! Optimizer rule to extract equijoin expr from filter
//! [`ExtractEquijoinPredicate`] rule that extracts equijoin predicates
use crate::optimizer::ApplyOrder;
use crate::utils::split_conjunction;
use crate::{OptimizerConfig, OptimizerRule};
Expand All @@ -28,7 +28,17 @@ use std::sync::Arc;
// equijoin predicate
type EquijoinPredicate = (Expr, Expr);

/// Optimization rule that extract equijoin expr from the filter
/// Optimizer that splits conjunctive join predicates into equijoin
/// predicates and (other) filter predicates.
///
/// Join algorithms are often highly optimized for equality predicates such as `x = y`,
/// often called `equijoin` predicates, so it is important to locate such predicates
/// and treat them specially.
///
/// For example, `SELECT ... FROM A JOIN B ON (A.x = B.y AND B.z > 50)`
/// has one equijoin predicate (`A.x = B.y`) and one filter predicate (`B.z > 50`).
/// See [find_valid_equijoin_key_pair] for more information on what predicates
/// are considered equijoins.
#[derive(Default)]
pub struct ExtractEquijoinPredicate;

Expand Down

0 comments on commit bcc2acd

Please sign in to comment.