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.
- Alphabetic
- By Inheritance
- VariantVal
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new VariantVal(value: Array[Byte], metadata: Array[Byte])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def debugString(): String
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- 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()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getMetadata(): Array[Byte]
- def getValue(): Array[Byte]
- def hashCode(): Int
- Definition Classes
- VariantVal → AnyRef → Any
- Annotations
- @Override()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toJson(zoneId: ZoneId): String
- 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()
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)