dawidwys commented on a change in pull request #8062: [FLINK-11884][table] Implement expression resolution on top of new Expressions URL: https://github.com/apache/flink/pull/8062#discussion_r277756475
########## File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/logical/groupWindows.scala ########## @@ -39,164 +34,39 @@ case class LogicalOverWindow( following: Optional[Expression]) // ------------------------------------------------------------------------------------------------ -// Tumbling group windows +// Group windows // ------------------------------------------------------------------------------------------------ +sealed trait LogicalWindow { + def timeAttribute: PlannerExpression + def aliasAttribute: PlannerExpression +} + case class TumblingGroupWindow( - alias: PlannerExpression, - timeField: PlannerExpression, + aliasAttribute: PlannerExpression, + timeAttribute: PlannerExpression, size: PlannerExpression) - extends LogicalWindow( - alias, - timeField) { - - override def resolveExpressions( - resolve: (PlannerExpression) => PlannerExpression): LogicalWindow = - TumblingGroupWindow( - resolve(alias), - resolve(timeField), - resolve(size)) - - override def validate(tableEnv: TableEnvironment): ValidationResult = - super.validate(tableEnv).orElse( - tableEnv match { - - // check size - case _ if !isTimeIntervalLiteral(size) && !isRowCountLiteral(size) => - ValidationFailure( - "Tumbling window expects size literal of type Interval of Milliseconds " + Review comment: Actually I somehow missed that check. We also didn't have tests for this case unfortunately. I reintroduced this check and added tests to validate it. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services