Object

org.apache.flink.api.scala.typeutils

Types

Related Doc: package typeutils

Permalink

object Types

This class gives access to the type information of the most common Scala types for which Flink has built-in serializers and comparators.

This class contains types of org.apache.flink.api.common.typeinfo.Types and adds types for Scala specific classes (such as Unit or case classes).

In many cases, Flink tries to analyze generic signatures of functions to determine return types automatically. This class is intended for cases where type information has to be supplied manually or cases where automatic type inference results in an inefficient type.

Scala macros allow to determine type information of classes and type parameters. You can use Types.of to let type information be determined automatically.

Annotations
@PublicEvolving()
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Types
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val BOOLEAN: TypeInformation[Boolean]

    Permalink

    Returns type information for primitive Boolean and java.lang.Boolean.

    Returns type information for primitive Boolean and java.lang.Boolean. Does not support a null value.

  5. val BYTE: TypeInformation[Byte]

    Permalink

    Returns type information for primitive Byte and java.lang.Byte.

    Returns type information for primitive Byte and java.lang.Byte. Does not support a null value.

  6. def CASE_CLASS[T](implicit arg0: TypeInformation[T]): TypeInformation[T]

    Permalink

    Returns type information for a Scala case class and Scala tuples.

    Returns type information for a Scala case class and Scala tuples.

    A Scala case class is a fixed-length composite type for storing multiple values in a deterministic field order. Fields of a case class are typed. Case classes and tuples are the most efficient composite type; therefore, they do not not support null-valued fields unless the type of the field supports nullability.

    Example use: Types.CASE_CLASS[MyCaseClass]

    T

    case class to be analyzed

  7. val CHAR: TypeInformation[Character]

    Permalink

    Returns type information for primitive Char and java.lang.Character.

    Returns type information for primitive Char and java.lang.Character. Does not support a null value.

  8. val DOUBLE: TypeInformation[Double]

    Permalink

    Returns type information for primitive Double and java.lang.Double.

    Returns type information for primitive Double and java.lang.Double. Does not support a null value.

  9. def EITHER[A, B](leftType: TypeInformation[A], rightType: TypeInformation[B]): TypeInformation[Either[A, B]]

    Permalink

    Returns type information for Scala Either type.

    Returns type information for Scala Either type. Null values are not supported.

    The either type can be used for a value of two possible types.

    Example use: Types.EITHER(Types.INT, Types.NOTHING]

    leftType

    type information of left side / Left

    rightType

    type information of right side / Right

  10. def ENUMERATION[E <: Enumeration](enum: E, valueClass: Class[Types.ENUMERATION.E.Value]): TypeInformation[Types.ENUMERATION.E.Value]

    Permalink

    Returns type information for Scala enumerations.

    Returns type information for Scala enumerations. Null values are not supported.

    enum

    enumeration object

    valueClass

    value class

  11. val FLOAT: TypeInformation[Float]

    Permalink

    Returns type information for primitive Float and java.lang.Float.

    Returns type information for primitive Float and java.lang.Float. Does not support a null value.

  12. def GENERIC[T](genericClass: Class[T]): TypeInformation[T]

    Permalink

    Returns generic type information for any Scala/Java object.

    Returns generic type information for any Scala/Java object. The serialization logic will use the general purpose serializer Kryo.

    Generic types are black-boxes for Flink, but allow any object and null values in fields.

    By default, serialization of this type is not very efficient. Please read the documentation about how to improve efficiency (namely by pre-registering classes).

    genericClass

    any Scala/Java class

  13. val INT: TypeInformation[Integer]

    Permalink

    Returns type information for primitive Int and java.lang.Integer.

    Returns type information for primitive Int and java.lang.Integer. Does not support a null value.

  14. val JAVA_BIG_DEC: TypeInformation[BigDecimal]

    Permalink

    Returns type information for Java java.math.BigDecimal.

    Returns type information for Java java.math.BigDecimal. Supports a null value.

    Note that Scala BigDecimal is not supported yet.

  15. val JAVA_BIG_INT: TypeInformation[BigInteger]

    Permalink

    Returns type information for Java java.math.BigInteger.

    Returns type information for Java java.math.BigInteger. Supports a null value.

    Note that Scala BigInt is not supported yet.

  16. val LONG: TypeInformation[Long]

    Permalink

    Returns type information for primitive Long and java.lang.Long.

    Returns type information for primitive Long and java.lang.Long. Does not support a null value.

  17. val NOTHING: TypeInformation[Nothing]

    Permalink

    Returns type information for Scala Nothing.

    Returns type information for Scala Nothing. Does not support a null value.

  18. def OBJECT_ARRAY[E <: AnyRef](elementType: TypeInformation[E]): TypeInformation[Array[E]]

    Permalink

    Returns type information for Scala/Java arrays of object types (such as Array[String], Array[java.lang.Integer]).

    Returns type information for Scala/Java arrays of object types (such as Array[String], Array[java.lang.Integer]). The array itself must not be null. Null values for elements are supported.

    elementType

    element type of the array

  19. def OPTION[A, T <: Option[A]](valueType: TypeInformation[A]): TypeInformation[T]

    Permalink

    Returns type information for Scala Option type.

    Returns type information for Scala Option type. Null values are not supported.

    The option type can be used for distinguishing between a value or no value.

    Example use: Types.OPTION(Types.INT)

    valueType

    type information of the option's value

  20. def POJO[T](pojoClass: Class[T], fields: Map[String, TypeInformation[_]]): TypeInformation[T]

    Permalink

    Returns type information for a POJO (Plain Old Java Object) and allows to specify all fields manually.

    Returns type information for a POJO (Plain Old Java Object) and allows to specify all fields manually.

    A POJO class is public and standalone (no non-static inner class). It has a public no-argument constructor. All non-static, non-transient fields in the class (and all superclasses) are either public (and non-final) or have a public getter and a setter method that follows the Java beans naming conventions for getters and setters.

    A POJO is a fixed-length, null-aware composite type with non-deterministic field order. Every field can be null independent of the field's type.

    The generic types for all fields of the POJO can be defined in a hierarchy of subclasses.

    If Flink's type analyzer is unable to extract a POJO field, an org.apache.flink.api.common.functions.InvalidTypesException is thrown.

    Note: In most cases the type information of fields can be determined automatically, we recommend to use Types.POJO(Class).

    pojoClass

    POJO class

    fields

    map of fields that map a name to type information. The map key is the name of the field and the value is its type.

  21. def POJO[T](pojoClass: Class[T]): TypeInformation[T]

    Permalink

    Returns type information for a POJO (Plain Old Java Object).

    Returns type information for a POJO (Plain Old Java Object).

    A POJO class is public and standalone (no non-static inner class). It has a public no-argument constructor. All non-static, non-transient fields in the class (and all superclasses) are either public (and non-final) or have a public getter and a setter method that follows the Java beans naming conventions for getters and setters.

    A POJO is a fixed-length, null-aware composite type with non-deterministic field order. Every field can be null independent of the field's type.

    The generic types for all fields of the POJO can be defined in a hierarchy of subclasses.

    If Flink's type analyzer is unable to extract a valid POJO type information with type information for all fields, an org.apache.flink.api.common.functions.InvalidTypesException} is thrown. Alternatively, you can use Map) to specify all fields manually.

    pojoClass

    POJO class to be analyzed by Flink

  22. def PRIMITIVE_ARRAY(elementType: TypeInformation[_]): TypeInformation[_]

    Permalink

    Returns type information for Scala/Java arrays of primitive type (such as Array[Byte]).

    Returns type information for Scala/Java arrays of primitive type (such as Array[Byte]). The array and its elements do not support null values.

    elementType

    element type of the array (e.g. Types.BOOLEAN, Types.INT, Types.DOUBLE)

  23. def ROW(fieldNames: Array[String], types: Array[TypeInformation[_]]): TypeInformation[Row]

    Permalink

    Returns type information for org.apache.flink.types.Row with fields of the given types and with given names.

    Returns type information for org.apache.flink.types.Row with fields of the given types and with given names. A row must not be null.

    A row is a variable-length, null-aware composite type for storing multiple values in a deterministic field order. Every field can be null independent of the field's type. The type of row fields cannot be automatically inferred; therefore, it is required to provide type information whenever a row is used.

    The schema of rows can have up to Integer.MAX_VALUE fields, however, all row instances must strictly adhere to the schema defined by the type info.

    Example use: Types.ROW(Array("name", "number"), Array(Types.STRING, Types.INT)).

    fieldNames

    array of field names

    types

    array of field types

  24. def ROW(types: TypeInformation[_]*): TypeInformation[Row]

    Permalink

    Returns type information for org.apache.flink.types.Row with fields of the given types.

    Returns type information for org.apache.flink.types.Row with fields of the given types. A row itself must not be null.

    A row is a fixed-length, null-aware composite type for storing multiple values in a deterministic field order. Every field can be null regardless of the field's type. The type of row fields cannot be automatically inferred; therefore, it is required to provide type information whenever a row is used.

    The schema of rows can have up to Integer.MAX_VALUE fields, however, all row instances must strictly adhere to the schema defined by the type info.

    This method generates type information with fields of the given types; the fields have the default names (f0, f1, f2 ..).

    types

    The types of the row fields, e.g., Types.STRING, Types.INT

  25. val SHORT: TypeInformation[Short]

    Permalink

    Returns type information for primitive Short and java.lang.Short.

    Returns type information for primitive Short and java.lang.Short. Does not support a null value.

  26. val SQL_DATE: TypeInformation[Date]

    Permalink

    Returns type information for java.sql.Date.

    Returns type information for java.sql.Date. Supports a null value.

  27. val SQL_TIME: TypeInformation[Time]

    Permalink

    Returns type information for java.sql.Time.

    Returns type information for java.sql.Time. Supports a null value.

  28. val SQL_TIMESTAMP: TypeInformation[Timestamp]

    Permalink

    Returns type information for java.sql.Timestamp.

    Returns type information for java.sql.Timestamp. Supports a null value.

  29. val STRING: TypeInformation[String]

    Permalink

    Returns type information for String and java.lang.String.

    Returns type information for String and java.lang.String. Supports a null value.

  30. def TRAVERSABLE[T](implicit arg0: TypeInformation[T]): TypeInformation[T]

    Permalink

    Returns type information for Scala collections that implement Traversable.

    Returns type information for Scala collections that implement Traversable. Null values are not supported.

  31. def TRY[A, T <: Try[A]](valueType: TypeInformation[A]): TypeInformation[T]

    Permalink

    Returns type information for Scala Try type.

    Returns type information for Scala Try type. Null values are not supported.

    The try type can be used for distinguishing between a value or throwable.

    Example use: Types.TRY(Types.INT)

    valueType

    type information of the try's value

  32. def TUPLE[T](implicit arg0: TypeInformation[T]): TypeInformation[T]

    Permalink

    Returns type information for a Scala tuple.

    Returns type information for a Scala tuple.

    A Scala tuple is a fixed-length composite type for storing multiple values in a deterministic field order. Fields of a tuple are typed. Tuples are the most efficient composite type; therefore, they do not not support null-valued fields unless the type of the field supports nullability.

    Example use: Types.TUPLE[(String, Int)]

    T

    tuple to be analyzed

  33. val UNIT: TypeInformation[Unit]

    Permalink

    Returns type information for Scala Unit.

    Returns type information for Scala Unit. Does not support a null value.

  34. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  35. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  37. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  38. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  39. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  40. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  41. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  42. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  43. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  44. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  45. def of[T](implicit arg0: TypeInformation[T]): TypeInformation[T]

    Permalink

    Generates type information based on the given class and/or its type parameters.

    Generates type information based on the given class and/or its type parameters.

    The definition is similar to a org.apache.flink.api.common.typeinfo.TypeHint but does not require to implement anonymous classes.

    If the class could not be analyzed by the Scala type analyzer, the Java analyzer will be used.

    Example use:

    Types.of[(Int, String, String)] for Scala tuples Types.of[Unit] for Scala specific types

    T

    class to be analyzed

  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped