Skip to content

Commit 3930830

Browse files
alambjonathanc-n
andauthored
Minor: improve LogicalPlanBuilder::join_with_expr_keys docs (#13276)
* Minor: improve LogicalPlanBuilder::join_with_expr_keys docs * Update datafusion/expr/src/logical_plan/builder.rs Co-authored-by: Jonathan Chen <[email protected]> --------- Co-authored-by: Jonathan Chen <[email protected]>
1 parent 40ba092 commit 3930830

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

datafusion/expr/src/logical_plan/builder.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ impl LogicalPlanBuilder {
777777
self.join_detailed(right, join_type, join_keys, filter, false)
778778
}
779779

780-
/// Apply a join with using the specified expressions.
780+
/// Apply a join using the specified expressions.
781781
///
782782
/// Note that DataFusion automatically optimizes joins, including
783783
/// identifying and optimizing equality predicates.
@@ -1200,12 +1200,20 @@ impl LogicalPlanBuilder {
12001200
Ok(Arc::unwrap_or_clone(self.plan))
12011201
}
12021202

1203-
/// Apply a join with the expression on constraint.
1203+
/// Apply a join with both explicit equijoin and non equijoin predicates.
12041204
///
1205-
/// equi_exprs are "equijoin" predicates expressions on the existing and right inputs, respectively.
1205+
/// Note this is a low level API that requires identifying specific
1206+
/// predicate types. Most users should use [`join_on`](Self::join_on) that
1207+
/// automatically identifies predicates appropriately.
12061208
///
1207-
/// filter: any other filter expression to apply during the join. equi_exprs predicates are likely
1208-
/// to be evaluated more quickly than the filter expressions
1209+
/// `equi_exprs` defines equijoin predicates, of the form `l = r)` for each
1210+
/// `(l, r)` tuple. `l`, the first element of the tuple, must only refer
1211+
/// to columns from the existing input. `r`, the second element of the tuple,
1212+
/// must only refer to columns from the right input.
1213+
///
1214+
/// `filter` contains any other other filter expression to apply during the
1215+
/// join. Note that `equi_exprs` predicates are evaluated more efficiently
1216+
/// than the filter expressions, so they are preferred.
12091217
pub fn join_with_expr_keys(
12101218
self,
12111219
right: LogicalPlan,

0 commit comments

Comments
 (0)