Class SparkAvroWriter

java.lang.Object
org.apache.iceberg.spark.data.SparkAvroWriter
All Implemented Interfaces:
org.apache.avro.io.DatumWriter<org.apache.spark.sql.catalyst.InternalRow>, org.apache.iceberg.avro.MetricsAwareDatumWriter<org.apache.spark.sql.catalyst.InternalRow>

public class SparkAvroWriter extends Object implements org.apache.iceberg.avro.MetricsAwareDatumWriter<org.apache.spark.sql.catalyst.InternalRow>
  • Constructor Summary

    Constructors
    Constructor
    Description
    SparkAvroWriter(org.apache.iceberg.Schema icebergSchema, org.apache.spark.sql.types.StructType dsSchema)
     
    SparkAvroWriter(org.apache.spark.sql.types.StructType dsSchema)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Stream<org.apache.iceberg.FieldMetrics>
     
    void
    setSchema(org.apache.avro.Schema schema)
     
    void
    write(org.apache.spark.sql.catalyst.InternalRow datum, org.apache.avro.io.Encoder out)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.avro.io.DatumWriter

    toByteArray
  • Constructor Details

    • SparkAvroWriter

      public SparkAvroWriter(org.apache.spark.sql.types.StructType dsSchema)
    • SparkAvroWriter

      public SparkAvroWriter(org.apache.iceberg.Schema icebergSchema, org.apache.spark.sql.types.StructType dsSchema)
  • Method Details

    • setSchema

      public void setSchema(org.apache.avro.Schema schema)
      Specified by:
      setSchema in interface org.apache.avro.io.DatumWriter<org.apache.spark.sql.catalyst.InternalRow>
    • write

      public void write(org.apache.spark.sql.catalyst.InternalRow datum, org.apache.avro.io.Encoder out) throws IOException
      Specified by:
      write in interface org.apache.avro.io.DatumWriter<org.apache.spark.sql.catalyst.InternalRow>
      Throws:
      IOException
    • metrics

      public Stream<org.apache.iceberg.FieldMetrics> metrics()
      Specified by:
      metrics in interface org.apache.iceberg.avro.MetricsAwareDatumWriter<org.apache.spark.sql.catalyst.InternalRow>