Skip to content

Commit 49f8251

Browse files
committed
is_asof_join
1 parent 6356e71 commit 49f8251

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/query/service/src/physical_plans/physical_join.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,7 @@ impl PhysicalPlanBuilder {
164164

165165
// 2. Build physical plan.
166166
// Choose physical join type by join conditions
167-
if matches!(
168-
join.join_type,
169-
JoinType::Asof | JoinType::LeftAsof | JoinType::RightAsof
170-
) {
167+
if join.join_type.is_asof_join() {
171168
let left_rel_expr = RelExpr::with_s_expr(s_expr.left_child());
172169
let right_rel_expr = RelExpr::with_s_expr(s_expr.right_child());
173170
let left_prop = left_rel_expr.derive_relational_prop()?;

src/query/sql/src/planner/binder/bind_table_reference/bind_join.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,7 @@ impl Binder {
452452
build_side_cache_info,
453453
};
454454

455-
if matches!(
456-
logical_join.join_type,
457-
JoinType::Asof | JoinType::LeftAsof | JoinType::RightAsof
458-
) {
455+
if logical_join.join_type.is_asof_join() {
459456
self.rewrite_asof(logical_join, left_child, right_child)
460457
} else {
461458
Ok(SExpr::create_binary(

src/query/sql/src/planner/plans/join.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ impl JoinType {
118118
JoinType::InnerAny | JoinType::LeftAny | JoinType::RightAny
119119
)
120120
}
121+
122+
pub fn is_asof_join(&self) -> bool {
123+
matches!(
124+
self,
125+
JoinType::Asof | JoinType::LeftAsof | JoinType::RightAsof
126+
)
127+
}
121128
}
122129

123130
impl Display for JoinType {

0 commit comments

Comments
 (0)