Class RowToAvroConverter

java.lang.Object
com.linkedin.venice.spark.utils.RowToAvroConverter

public final class RowToAvroConverter extends Object
A utility class to convert Spark SQL Row to an Avro GenericRecord with the specified schema. This has been written in accordance with the following resources: Spark's implementation is not ideal to be used directly for two reasons:
  • It cannot handle complex unions in the version of Spark that we use (3.3.3). The support was added in 3.4.0.
  • It converts directly to Avro binary that we need to deserialize, and that incurs an additional serde cost.
  • Method Details

    • convert

      public static org.apache.avro.generic.GenericRecord convert(org.apache.spark.sql.Row row, org.apache.avro.Schema schema)