Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzwang committed Nov 22, 2024
1 parent 08d8297 commit 22fed28
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/daft-dsl/src/resolve_expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,8 @@ fn expand_wildcards(
/// - sum(col("a")) + col("b") when "b" is not a group by key
/// - not all branches are aggregations
fn has_single_agg_layer(expr: &ExprRef, groupby: &HashSet<ExprRef>) -> bool {
if groupby.contains(expr) {
true
} else {
match expr.as_ref() {
groupby.contains(expr)
|| match expr.as_ref() {
Expr::Agg(agg_expr) => !agg_expr.children().iter().any(has_agg),
Expr::Column(_) => false,
Expr::Literal(_) => true,
Expand All @@ -237,7 +235,6 @@ fn has_single_agg_layer(expr: &ExprRef, groupby: &HashSet<ExprRef>) -> bool {
.iter()
.all(|e| has_single_agg_layer(e, groupby)),
}
}
}

fn convert_udfs_to_map_groups(expr: &ExprRef) -> ExprRef {
Expand Down

0 comments on commit 22fed28

Please sign in to comment.