org.apache.spark.sql.catalyst.encoders

ExpressionEncoder

case class ExpressionEncoder[T](schema: StructType, flat: Boolean, toRowExpressions: Seq[Expression], fromRowExpression: Expression, clsTag: ClassTag[T]) extends Encoder[T] with Product with Serializable

A generic encoder for JVM objects.

schema

The schema after converting T to a Spark SQL row.

toRowExpressions

A set of expressions, one for each top-level field that can be used to extract the values from a raw object into an InternalRow.

fromRowExpression

An expression that will construct an object given an InternalRow.

clsTag

A classtag for T.

Linear Supertypes
Product, Equals, Encoder[T], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ExpressionEncoder
  2. Product
  3. Equals
  4. Encoder
  5. Serializable
  6. Serializable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExpressionEncoder(schema: StructType, flat: Boolean, toRowExpressions: Seq[Expression], fromRowExpression: Expression, clsTag: ClassTag[T])

    schema

    The schema after converting T to a Spark SQL row.

    toRowExpressions

    A set of expressions, one for each top-level field that can be used to extract the values from a raw object into an InternalRow.

    fromRowExpression

    An expression that will construct an object given an InternalRow.

    clsTag

    A classtag for T.

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def assertUnresolved(): Unit

    The process of resolution to a given schema throws away information about where a given field is being bound by ordinal instead of by name.

    The process of resolution to a given schema throws away information about where a given field is being bound by ordinal instead of by name. This method checks to make sure this process has not been done already in places where we plan to do later composition of encoders.

  8. val attrs: Seq[String]

    Attributes
    protected
  9. def bind(schema: Seq[Attribute]): ExpressionEncoder[T]

    Returns a copy of this encoder where the expressions used to construct an object from an input row have been bound to the ordinals of the given schema.

    Returns a copy of this encoder where the expressions used to construct an object from an input row have been bound to the ordinals of the given schema. Note that you need to first call resolve before bind.

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. val clsTag: ClassTag[T]

    A classtag for T.

    A classtag for T.

    Definition Classes
    ExpressionEncoderEncoder
  12. def defaultBinding: ExpressionEncoder[T]

    Returns this encoder where it has been bound to its own output (i.

    Returns this encoder where it has been bound to its own output (i.e. no remaping of columns is performed).

  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. val flat: Boolean

  16. def fromRow(row: InternalRow): T

    Returns an object of type T, extracting the required values from the provided row.

    Returns an object of type T, extracting the required values from the provided row. Note that you must resolve and bind an encoder to a specific schema before you can call this function.

  17. val fromRowExpression: Expression

    An expression that will construct an object given an InternalRow.

  18. final def getClass(): Class[_]

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

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

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def resolve(schema: Seq[Attribute], outerScopes: ConcurrentMap[String, AnyRef]): ExpressionEncoder[T]

    Returns a new copy of this encoder, where the expressions used by fromRow are resolved to the given schema.

  24. val schema: StructType

    The schema after converting T to a Spark SQL row.

    The schema after converting T to a Spark SQL row.

    Definition Classes
    ExpressionEncoderEncoder
  25. val schemaString: String

    Attributes
    protected
  26. def shift(delta: Int): ExpressionEncoder[T]

    Returns a new encoder with input columns shifted by delta ordinals

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

    Definition Classes
    AnyRef
  28. def toRow(t: T): InternalRow

    Returns an encoded version of t as a Spark SQL row.

    Returns an encoded version of t as a Spark SQL row. Note that multiple calls to toRow are allowed to return the same actual InternalRow object. Thus, the caller should copy the result before making another call if required.

  29. val toRowExpressions: Seq[Expression]

    A set of expressions, one for each top-level field that can be used to extract the values from a raw object into an InternalRow.

  30. def toString(): String

    Definition Classes
    ExpressionEncoder → AnyRef → Any
  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Product

Inherited from Equals

Inherited from Encoder[T]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped