Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3851#discussion_r116593574 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/logical/operators.scala --- @@ -215,14 +215,22 @@ case class Aggregate( } override def validate(tableEnv: TableEnvironment): LogicalNode = { - + implicit val relBuilder: RelBuilder = tableEnv.getRelBuilder val resolvedAggregate = super.validate(tableEnv).asInstanceOf[Aggregate] val groupingExprs = resolvedAggregate.groupingExpressions val aggregateExprs = resolvedAggregate.aggregateExpressions aggregateExprs.foreach(validateAggregateExpression) groupingExprs.foreach(validateGroupingExpression) def validateAggregateExpression(expr: Expression): Unit = expr match { + case Alias(child, _, _) => validateAggregateExpression(child) + // check user-defined aggregate function + case AggFunctionCall(agg, _) if agg.requiresOver => --- End diff -- Check this case also as ``` case aggExpr: Aggregation if aggExpr.getSqlAggFunction.requiresOver => ``` in case we add built-in Aggregations that require Over.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---