Skip to content

Commit

Permalink
add blacklist expr fn
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Dec 26, 2023
1 parent 9b866a8 commit e045932
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions df_engine_extensions/src/dist_sql_query/physical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,23 +620,20 @@ pub enum PushDownEvent {
}

impl PushDownEvent {
// Those aggregate functions can't be pushed down.
// https://github.com/apache/incubator-horaedb/issues/1405
fn blacklist_expr(expr: &dyn Any) -> bool {
expr.is::<ApproxPercentileCont>() || expr.is::<ApproxPercentileContWithWeight>()
}

pub fn new(plan: Arc<dyn ExecutionPlan>) -> Self {
if let Some(aggr) = plan.as_any().downcast_ref::<AggregateExec>() {
// Those aggregate functions can't be pushed down to `ResolvedPartitionedScan`
// https://github.com/apache/incubator-horaedb/issues/1405
for aggr_expr in aggr.aggr_expr() {
if aggr_expr
.as_any()
.downcast_ref::<ApproxPercentileCont>()
.is_some()
|| aggr_expr
.as_any()
.downcast_ref::<ApproxPercentileContWithWeight>()
.is_some()
{
if Self::blacklist_expr(aggr_expr.as_any()) {
return Self::Unable;
}
}

if *aggr.mode() == AggregateMode::Partial {
Self::Terminated(plan)
} else {
Expand Down

0 comments on commit e045932

Please sign in to comment.