Class/Object

org.apache.spark.sql.catalyst.encoders

ExpressionEncoder

Related Docs: object ExpressionEncoder | package encoders

Permalink

case class ExpressionEncoder[T](schema: StructType, flat: Boolean, serializer: Seq[Expression], deserializer: 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.

serializer

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.

deserializer

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

    schema

    The schema after converting T to a Spark SQL row.

    serializer

    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.

    deserializer

    An expression that will construct an object given an InternalRow.

    clsTag

    A classtag for T.

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. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def assertUnresolved(): Unit

    Permalink

    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.

  6. val attrs: Seq[String]

    Permalink
    Attributes
    protected
  7. def clone(): AnyRef

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

    Permalink

    A classtag for T.

    A classtag for T.

    Definition Classes
    ExpressionEncoderEncoder
  9. val deserializer: Expression

    Permalink

    An expression that will construct an object given an InternalRow.

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

    Permalink
    Definition Classes
    AnyRef
  11. def finalize(): Unit

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

    Permalink
  13. def fromRow(row: InternalRow): T

    Permalink

    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 resolveAndBind an encoder to a specific schema before you can call this function.

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

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

    Permalink
    Definition Classes
    Any
  16. def namedExpressions: Seq[NamedExpression]

    Permalink

    Returns a new set (with unique ids) of NamedExpression that represent the serialized form of this object.

  17. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  20. def resolveAndBind(attrs: Seq[Attribute] = schema.toAttributes, analyzer: Analyzer = SimpleAnalyzer): ExpressionEncoder[T]

    Permalink

    Returns a new copy of this encoder, where the deserializer is resolved and bound to the given schema.

    Returns a new copy of this encoder, where the deserializer is resolved and bound to the given schema.

    Note that, ideally encoder is used as a container of serde expressions, the resolution and binding stuff should happen inside query framework. However, in some cases we need to use encoder as a function to do serialization directly(e.g. Dataset.collect), then we can use this method to do resolution and binding outside of query framework.

  21. val schema: StructType

    Permalink

    The schema after converting T to a Spark SQL row.

    The schema after converting T to a Spark SQL row.

    Definition Classes
    ExpressionEncoderEncoder
  22. val schemaString: String

    Permalink
    Attributes
    protected
  23. val serializer: Seq[Expression]

    Permalink

    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.

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

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

    Permalink

    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.

  26. def toString(): String

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

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

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

    Permalink
    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