Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/1926#discussion_r60923428
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/table.scala
---
@@ -401,6 +400,52 @@ class Table(
new Table(relBuilder.build(), tableEnv)
}
+ /**
+ * Sorts the given [[Table]]. Similar to SQL ORDER BY. The sorting is
performed locally across
+ * all partitions with keys equal to the given fields.
+ *
+ * Example:
+ *
+ * {{{
+ * tab.orderBy('name)
+ * }}}
+ */
+ def orderBy(fields: Expression*): Table = {
+ relBuilder.push(relNode)
+
+ if (! fields.forall {
+ case x: UnresolvedFieldReference => true
+ case x@(_: Asc | _: Desc) => x.asInstanceOf[UnaryExpression]
--- End diff --
With a common base class of `Asc` and `Desc` this can be done nicer.
---
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.
---