jayzhan211 commented on code in PR #15287: URL: https://github.com/apache/datafusion/pull/15287#discussion_r2000153792
########## datafusion/sql/src/select.rs: ########## @@ -826,6 +827,13 @@ impl<S: ContextProvider> SqlToRel<'_, S> { .map(|expr| rebase_expr(expr, &aggr_projection_exprs, input)) .collect::<Result<Vec<Expr>>>()?; + // check if the columns in the SELECT list are in the GROUP BY clause + // or are part of an aggregate function, if not, throw an error. + validate_columns_in_group_by_or_aggregate( Review Comment: It seems like the error should be handled in the `check_columns_satisfy_exprs` below with `ProjectionMustReferenceAggregate`, is it possible to unify these 2? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org