Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package apache
    Definition Classes
    org
  • package flink
    Definition Classes
    apache
  • package api
    Definition Classes
    flink
  • package scala

    The Flink Scala API.

    The Flink Scala API. org.apache.flink.api.scala.ExecutionEnvironment is the starting-point of any Flink program. It can be used to read from local files, HDFS, or other sources. org.apache.flink.api.scala.DataSet is the main abstraction of data in Flink. It provides operations that create new DataSets via transformations. org.apache.flink.api.scala.GroupedDataSet provides operations on grouped data that results from org.apache.flink.api.scala.DataSet.groupBy().

    Use org.apache.flink.api.scala.ExecutionEnvironment.getExecutionEnvironment to obtain an execution environment. This will either create a local environment or a remote environment, depending on the context where your program is executing.

    Definition Classes
    api
    Deprecated

    All Flink Scala APIs are deprecated and will be removed in a future Flink version. You can still build your application in Scala, but you should move to the Java version of either the DataStream and/or Table API.

    See also

    FLIP-265 Deprecate and remove Scala API support

  • package extensions

    acceptPartialFunctions extends the original DataSet with methods with unique names that delegate to core higher-order functions (e.g.

    acceptPartialFunctions extends the original DataSet with methods with unique names that delegate to core higher-order functions (e.g. map) so that we can work around the fact that overloaded methods taking functions as parameters can't accept partial functions as well. This enables the possibility to directly apply pattern matching to decompose inputs such as tuples, case classes and collections.

    The following is a small example that showcases how this extensions would work on a Flink data set:

    object Main {
      import org.apache.flink.api.scala.extensions._
      case class Point(x: Double, y: Double)
      def main(args: Array[String]): Unit = {
        val env = ExecutionEnvironment.getExecutionEnvironment
        val ds = env.fromElements(Point(1, 2), Point(3, 4), Point(5, 6))
        ds.filterWith {
          case Point(x, _) => x > 1
        }.reduceWith {
          case (Point(x1, y1), (Point(x2, y2))) => Point(x1 + y1, x2 + y2)
        }.mapWith {
          case Point(x, y) => (x, y)
        }.flatMapWith {
          case (x, y) => Seq('x' -> x, 'y' -> y)
        }.groupingBy {
          case (id, value) => id
        }
      }
    }

    The extension consists of several implicit conversions over all the data set representations that could gain from this feature. To use this set of extensions methods the user has to explicitly opt-in by importing org.apache.flink.api.scala.extensions.acceptPartialFunctions.

    For more information and usage examples please consult the Apache Flink official documentation.

    Definition Classes
    scala
    Deprecated

    All Flink Scala APIs are deprecated and will be removed in a future Flink major version. You can still build your application in Scala, but you should move to the Java version of either the DataStream and/or Table API.

    See also

    FLIP-265 Deprecate and remove Scala API support

  • package impl
    Definition Classes
    extensions
  • package acceptPartialFunctions
    Definition Classes
    impl
  • OnCoGroupDataSet
  • OnCrossDataSet
  • OnDataSet
  • OnGroupedDataSet
  • OnHalfUnfinishedKeyPairOperation
  • OnJoinFunctionAssigner
  • OnUnfinishedKeyPairOperation
p

org.apache.flink.api.scala.extensions.impl

acceptPartialFunctions

package acceptPartialFunctions

Type Members

  1. class OnCoGroupDataSet[L, R] extends AnyRef

    Wraps a co-group data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    Wraps a co-group data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    L

    The type of the left data set items

    R

    The type of the right data set items

    Annotations
    @deprecated
    Deprecated

    (Since version 1.18.0)

    See also

    FLIP-265 Deprecate and remove Scala API support

  2. class OnCrossDataSet[L, R] extends AnyRef

    Wraps a cross data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    Wraps a cross data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    L

    The type of the left data set items

    R

    The type of the right data set items

    Annotations
    @deprecated
    Deprecated

    (Since version 1.18.0)

    See also

    FLIP-265 Deprecate and remove Scala API support

  3. class OnDataSet[T] extends AnyRef

    Wraps a data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    Wraps a data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    T

    The type of the data set items

    Annotations
    @deprecated
    Deprecated

    (Since version 1.18.0)

    See also

    FLIP-265 Deprecate and remove Scala API support

  4. class OnGroupedDataSet[T] extends AnyRef

    Wraps a grouped data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    Wraps a grouped data set, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    T

    The type of the grouped data set items

    Annotations
    @deprecated
    Deprecated

    (Since version 1.18.0)

    See also

    FLIP-265 Deprecate and remove Scala API support

  5. class OnHalfUnfinishedKeyPairOperation[L, R, O] extends AnyRef

    Wraps an half unfinished key pair operation, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    Wraps an half unfinished key pair operation, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    L

    The type of the left data set items

    R

    The type of the right data set items

    O

    The type of the output data set items

    Annotations
    @deprecated
    Deprecated

    (Since version 1.18.0)

    See also

    FLIP-265 Deprecate and remove Scala API support

  6. class OnJoinFunctionAssigner[L, R] extends AnyRef

    Wraps a join function assigner, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    Wraps a join function assigner, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    L

    The type of the left data set items

    R

    The type of the right data set items

    Annotations
    @deprecated
    Deprecated

    (Since version 1.18.0)

    See also

    FLIP-265 Deprecate and remove Scala API support

  7. class OnUnfinishedKeyPairOperation[L, R, O] extends AnyRef

    Wraps an unfinished key pair operation, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    Wraps an unfinished key pair operation, allowing to use anonymous partial functions to perform extraction of items in a tuple, case class instance or collection

    L

    The type of the left data set items

    R

    The type of the right data set items

    O

    The type of the output data set items

    Annotations
    @deprecated
    Deprecated

    (Since version 1.18.0)

    See also

    FLIP-265 Deprecate and remove Scala API support

Ungrouped