Package dev.vortex.spark.write
Class SparkToArrowSchema
java.lang.Object
dev.vortex.spark.write.SparkToArrowSchema
Utility class for converting Spark SQL schemas to Arrow schemas.
This enables the conversion of Spark DataFrames to Arrow format for writing to Vortex files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic dev.vortex.relocated.org.apache.arrow.vector.types.pojo.Schemaconvert(org.apache.spark.sql.types.StructType sparkSchema) Converts a Spark StructType schema to an Arrow Schema.static booleansupportsDataType(org.apache.spark.sql.types.DataType dataType) Returns whether Vortex's Spark writer can represent this Spark SQL type.
-
Method Details
-
supportsDataType
public static boolean supportsDataType(org.apache.spark.sql.types.DataType dataType) Returns whether Vortex's Spark writer can represent this Spark SQL type. -
convert
public static dev.vortex.relocated.org.apache.arrow.vector.types.pojo.Schema convert(org.apache.spark.sql.types.StructType sparkSchema) Converts a Spark StructType schema to an Arrow Schema.- Parameters:
sparkSchema- the Spark schema to convert- Returns:
- the corresponding Arrow schema
-