Skip to content

Commit

Permalink
Fix regression with TPC-H benchmark (#1060)
Browse files Browse the repository at this point in the history
* Fix regression with TPC-H benchmark

* add link to issue
  • Loading branch information
andygrove authored Sep 24, 2024
1 parent e39a7e6 commit 51adfb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ballista/executor/src/execution_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ use ballista_core::error::BallistaError;
use ballista_core::serde::scheduler::{ExecutorSpecification, PartitionId};
use ballista_core::serde::BallistaCodec;
use datafusion::execution::context::TaskContext;
use datafusion::functions::datetime::date_part;
use datafusion::functions::unicode::substr;
use datafusion::functions_aggregate::covariance::{covar_pop_udaf, covar_samp_udaf};
use datafusion::functions_aggregate::sum::sum_udaf;
use datafusion::functions_aggregate::variance::var_samp_udaf;
Expand Down Expand Up @@ -199,6 +201,10 @@ async fn run_received_task<T: 'static + AsLogicalPlan, U: 'static + AsExecutionP
task_aggregate_functions.insert("covar_pop".to_string(), covar_pop_udaf());
task_aggregate_functions.insert("SUM".to_string(), sum_udaf());

// TODO which other functions need adding here?
task_scalar_functions.insert("date_part".to_string(), date_part());
task_scalar_functions.insert("substr".to_string(), substr());

for window_func in executor.window_functions.clone() {
task_window_functions.insert(window_func.0, window_func.1);
}
Expand Down
10 changes: 6 additions & 4 deletions ballista/scheduler/src/state/execution_graph/execution_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use std::sync::Arc;
use std::time::{SystemTime, UNIX_EPOCH};

use datafusion::physical_optimizer::aggregate_statistics::AggregateStatistics;
use datafusion::physical_optimizer::join_selection::JoinSelection;
use datafusion::physical_optimizer::PhysicalOptimizerRule;
use datafusion::physical_plan::display::DisplayableExecutionPlan;
use datafusion::physical_plan::metrics::{MetricValue, MetricsSet};
Expand Down Expand Up @@ -349,10 +348,13 @@ impl UnresolvedStage {
&input_locations,
)?;

// TODO reinstate this logic once https://github.com/apache/datafusion/issues/10978
// is fixed
// Optimize join order and statistics based on new resolved statistics
let optimize_join = JoinSelection::new();
let config = SessionConfig::default();
let plan = optimize_join.optimize(plan, config.options())?;
// let optimize_join = JoinSelection::new();
// let config = SessionConfig::default();
// let plan = optimize_join.optimize(plan, config.options())?;

let optimize_aggregate = AggregateStatistics::new();
let plan =
optimize_aggregate.optimize(plan, SessionConfig::default().options())?;
Expand Down

0 comments on commit 51adfb0

Please sign in to comment.