Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
leiysky committed Aug 23, 2022
1 parent 080b4e8 commit ad9fa14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/query/service/src/sql/optimizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ pub fn optimize_query(
) -> Result<SExpr> {
let rules = RuleList::create(DEFAULT_REWRITE_RULES.clone())?;

let contains_local_table_scan = contains_local_table_scan(&s_expr, &metadata);

let mut heuristic = HeuristicOptimizer::new(ctx, bind_context, metadata.clone(), rules);
let mut result = heuristic.optimize(s_expr)?;

Expand All @@ -144,8 +146,8 @@ pub fn optimize_query(

// So far, we don't have ability to execute distributed query
// with reading data from local tales(e.g. system tables).
let enable_distributed_query = opt_ctx.config.enable_distributed_optimization
&& !contains_local_table_scan(&s_expr, &metadata);
let enable_distributed_query =
opt_ctx.config.enable_distributed_optimization && !contains_local_table_scan;
if enable_distributed_query && validate_distributed_query(&result) {
result = optimize_distributed_query(&result)?;
}
Expand Down

0 comments on commit ad9fa14

Please sign in to comment.