mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 00:09:35 +00:00
fix: match one join query with join key filter (#6845)
close #6843 --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
greptile-apps[bot]
parent
53459dcecc
commit
f5cb6292a0
@@ -132,15 +132,6 @@ pub fn generate_optimizer_rules(sql: &Sql) -> Vec<Arc<dyn OptimizerRule + Send +
|
||||
rules.push(Arc::new(RewriteCipherCall::new()));
|
||||
#[cfg(feature = "enterprise")]
|
||||
rules.push(Arc::new(RewriteCipherKey::new(&sql.org_id)));
|
||||
|
||||
// should after ExtractEquijoinPredicate, because LimitJoinRightSide will
|
||||
// require the join's on columns
|
||||
if cfg.common.feature_join_match_one_enabled && cfg.common.feature_join_right_side_max_rows > 0
|
||||
{
|
||||
rules.push(Arc::new(LimitJoinRightSide::new(
|
||||
cfg.common.feature_join_right_side_max_rows,
|
||||
)));
|
||||
}
|
||||
// ************************************
|
||||
|
||||
// Filters can't be pushed down past Limits, we should do PushDownFilter after
|
||||
@@ -156,5 +147,16 @@ pub fn generate_optimizer_rules(sql: &Sql) -> Vec<Arc<dyn OptimizerRule + Send +
|
||||
rules.push(Arc::new(EliminateGroupByConstant::new()));
|
||||
rules.push(Arc::new(OptimizeProjections::new()));
|
||||
|
||||
// *********** custom rules ***********
|
||||
// should after ExtractEquijoinPredicate and PushDownFilter, because LimitJoinRightSide will
|
||||
// require the join's on columns, and if filter have join keys, it should be pushed down
|
||||
if cfg.common.feature_join_match_one_enabled && cfg.common.feature_join_right_side_max_rows > 0
|
||||
{
|
||||
rules.push(Arc::new(LimitJoinRightSide::new(
|
||||
cfg.common.feature_join_right_side_max_rows,
|
||||
)));
|
||||
}
|
||||
// ************************************
|
||||
|
||||
rules
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user