Package org.apache.iceberg.spark.data
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
ConstructorsConstructorDescriptionSparkAvroWriter(org.apache.iceberg.Schema icebergSchema, org.apache.spark.sql.types.StructType dsSchema) SparkAvroWriter(org.apache.spark.sql.types.StructType dsSchema) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
setSchemain interfaceorg.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:
writein interfaceorg.apache.avro.io.DatumWriter<org.apache.spark.sql.catalyst.InternalRow>- Throws:
IOException
-
metrics
- Specified by:
metricsin interfaceorg.apache.iceberg.avro.MetricsAwareDatumWriter<org.apache.spark.sql.catalyst.InternalRow>
-