You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by al...@apache.org on 2014/11/05 14:22:12 UTC

[2/2] git commit: [scala] Add union operation to Scala ExecutionEnvironment

[scala] Add union operation to Scala ExecutionEnvironment


Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/c3835cdf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/c3835cdf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/c3835cdf

Branch: refs/heads/master
Commit: c3835cdf3ac778d8246772a7a7c77ad9008f56b6
Parents: e21d78d
Author: Aljoscha Krettek <al...@gmail.com>
Authored: Wed Nov 5 08:17:30 2014 +0100
Committer: Aljoscha Krettek <al...@gmail.com>
Committed: Wed Nov 5 13:53:29 2014 +0100

----------------------------------------------------------------------
 .../scala/org/apache/flink/api/scala/ExecutionEnvironment.scala  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/c3835cdf/flink-scala/src/main/scala/org/apache/flink/api/scala/ExecutionEnvironment.scala
----------------------------------------------------------------------
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/ExecutionEnvironment.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/ExecutionEnvironment.scala
index ff96519..fd3e10d 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/ExecutionEnvironment.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/ExecutionEnvironment.scala
@@ -307,6 +307,10 @@ class ExecutionEnvironment(javaEnv: JavaEnv) {
     wrap(source).asInstanceOf[DataSet[Long]]
   }
 
+  def union[T](sets: Seq[DataSet[T]]): DataSet[T] = {
+    sets.reduce( (l, r) => l.union(r) )
+  }
+
   /**
    * Registers a file at the distributed cache under the given name. The file will be accessible
    * from any user-defined function in the (distributed) runtime under a local path. Files