Packages

class VariantVal extends Serializable

The physical data representation of org.apache.spark.sql.types.VariantType that represents a semi-structured value. It consists of two binary values: VariantVal#value and VariantVal#metadata. The value encodes types and values, but not field names. The metadata currently contains a version flag and a list of field names. We can extend/modify the detailed binary format given the version flag.

A VariantVal can be produced by casting another value into the Variant type or parsing a JSON string in the org.apache.spark.sql.catalyst.expressions.variant.ParseJson expression. We can extract a path consisting of field names and array indices from it, cast it into a concrete data type, or rebuild a JSON string from it.

The storage layout of this class in org.apache.spark.sql.catalyst.expressions.UnsafeRow and org.apache.spark.sql.catalyst.expressions.UnsafeArrayData is: the fixed-size part is a long value "offsetAndSize". The upper 32 bits is the offset that points to the start position of the actual binary content. The lower 32 bits is the total length of the binary content. The binary content contains: 4 bytes representing the length of VariantVal#value, content of VariantVal#value, content of VariantVal#metadata. This is an internal and transient format and can be modified at any time.

Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. VariantVal
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new VariantVal(value: Array[Byte], metadata: Array[Byte])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. def debugString(): String
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(other: AnyRef): Boolean

    Compare two variants in bytes.

    Compare two variants in bytes. The variant equality is more complex than it, and we haven't supported it in the user surface yet. This method is only intended for tests.

    Definition Classes
    VariantVal → AnyRef → Any
    Annotations
    @Override()
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. def getMetadata(): Array[Byte]
  11. def getValue(): Array[Byte]
  12. def hashCode(): Int
    Definition Classes
    VariantVal → AnyRef → Any
    Annotations
    @Override()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toJson(zoneId: ZoneId): String
  19. def toString(): String

    returns

    A human-readable representation of the Variant value. It is always a JSON string at this moment.

    Definition Classes
    VariantVal → AnyRef → Any
    Annotations
    @Override()
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped