Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3743#discussion_r112456485
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala
---
@@ -810,6 +810,47 @@ class Table(
new WindowedTable(this, window)
}
+ /**
+ * Groups the records of a table by assigning them to windows defined
by a time or row interval.
+ *
+ * For streaming tables of infinite size, grouping into windows is
required to define finite
+ * groups on which over-based aggregates can be computed.
+ *
+ * Over window for batch tables are currently not supported.
+ *
+ * @param overWindows windows that specifies how elements are grouped.
+ * @return Over windowed table
+ */
+ def window(overWindows: OverWindow*): OverWindowedTable = {
+
+ if (tableEnv.isInstanceOf[BatchTableEnvironment]) {
+ throw TableException("Over window for batch tables are currently not
supported.")
+ } else {
+ overWindows.foreach { overWindow =>
+ val orderName =
overWindow.orderBy.asInstanceOf[UnresolvedFieldReference].name
+ if (!orderName.equalsIgnoreCase("rowtime")
+ && !orderName.equalsIgnoreCase("proctime")) {
+ throw ValidationException(
+ s"OrderBy expression must be ['rowtime] or ['proctime], but
got ['${orderName}]")
+ }
+ }
+ }
+
+ if (overWindows.size != 1) {
+ throw TableException("OverWindow only supported single window at
current time.")
+ }
+
+ overWindows.foreach { overWindow =>
+ if (!overWindow.preceding.asInstanceOf[Literal].resultType.getClass
--- End diff --
This check should be done in `OverCall.validateInput()` as well.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---