All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fif.spark.avroparquet.GenericAvroMaterializer Maven / Gradle / Ivy

package fif.spark.avroparquet;

import com.nitro.scalaAvro.runtime.FromGenericRecord;
import org.apache.avro.Schema;
import parquet.io.api.GroupConverter;
import parquet.io.api.RecordMaterializer;
import parquet.schema.MessageType;

import java.io.Serializable;

class GenericAvroMaterializer extends RecordMaterializer implements Serializable {

    private AvroConverter root;

    public GenericAvroMaterializer(
            MessageType requestedSchema,
            Schema avroSchema,
            FromGenericRecord implGenRec
    ) {
        this.root = new AvroConverter<>(requestedSchema, avroSchema, implGenRec);
    }

    @Override
    public T getCurrentRecord() {
        return root.getCurrentRecord();
    }

    @Override
    public GroupConverter getRootConverter() {
        return root;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy