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>
,MetricsAwareDatumWriter<org.apache.spark.sql.catalyst.InternalRow>
public class SparkAvroWriter
extends Object
implements MetricsAwareDatumWriter<org.apache.spark.sql.catalyst.InternalRow>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionmetrics()
Returns a stream ofFieldMetrics
that this MetricsAwareDatumWriter keeps track of.void
setSchema
(org.apache.avro.Schema schema) void
write
(org.apache.spark.sql.catalyst.InternalRow datum, org.apache.avro.io.Encoder out)
-
Constructor Details
-
SparkAvroWriter
public SparkAvroWriter(org.apache.spark.sql.types.StructType dsSchema)
-
-
Method Details
-
setSchema
public void setSchema(org.apache.avro.Schema schema) - Specified by:
setSchema
in 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:
write
in interfaceorg.apache.avro.io.DatumWriter<org.apache.spark.sql.catalyst.InternalRow>
- Throws:
IOException
-
metrics
Description copied from interface:MetricsAwareDatumWriter
Returns a stream ofFieldMetrics
that this MetricsAwareDatumWriter keeps track of.- Specified by:
metrics
in interfaceMetricsAwareDatumWriter<org.apache.spark.sql.catalyst.InternalRow>
-