Package dev.vortex.spark
Class SparkVariants
java.lang.Object
dev.vortex.spark.SparkVariants
Spark's
VARIANT type, which Spark 4 introduced, as Vortex stores it: Arrow's arrow.parquet.variant
extension, a struct of the binary metadata and value of each variant.
Spark 3.5 has no VARIANT, and its build carries a class of this name that supports none.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic dev.vortex.relocated.org.apache.arrow.vector.types.pojo.FieldarrowField(String name, boolean nullable) The Arrow field holding a variant column namedname.static booleanisVariant(dev.vortex.relocated.org.apache.arrow.vector.types.pojo.Field field) Whetherfieldis Arrow's variant extension.static booleanisVariant(org.apache.spark.sql.types.DataType dataType) WhetherdataTypeis Spark's variant type.static Optional<org.apache.spark.sql.types.DataType>Spark's variant type, when this Spark has one.static voidwrite(dev.vortex.relocated.org.apache.arrow.vector.complex.StructVector vector, org.apache.spark.sql.catalyst.expressions.SpecializedGetters row, int ordinal, int index) Writes the variant atordinalofrowinto rowindexofvector.static voidwriteNull(dev.vortex.relocated.org.apache.arrow.vector.complex.StructVector vector, int index) Marks rowindexofvectornull, with empty, non-null parts.
-
Field Details
-
EXTENSION
The Arrow extension name Vortex reads as its variant type.- See Also:
-
-
Method Details
-
isVariant
public static boolean isVariant(org.apache.spark.sql.types.DataType dataType) WhetherdataTypeis Spark's variant type. -
variantType
Spark's variant type, when this Spark has one. -
isVariant
public static boolean isVariant(dev.vortex.relocated.org.apache.arrow.vector.types.pojo.Field field) Whetherfieldis Arrow's variant extension. -
arrowField
public static dev.vortex.relocated.org.apache.arrow.vector.types.pojo.Field arrowField(String name, boolean nullable) The Arrow field holding a variant column namedname. -
write
public static void write(dev.vortex.relocated.org.apache.arrow.vector.complex.StructVector vector, org.apache.spark.sql.catalyst.expressions.SpecializedGetters row, int ordinal, int index) Writes the variant atordinalofrowinto rowindexofvector. -
writeNull
public static void writeNull(dev.vortex.relocated.org.apache.arrow.vector.complex.StructVector vector, int index) Marks rowindexofvectornull, with empty, non-null parts.
-