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

com.google.cloud.hadoop.io.bigquery.AvroBigQueryInputFormat Maven / Gradle / Ivy

There is a newer version: 0.13.4-hadoop3
Show newest version
package com.google.cloud.hadoop.io.bigquery;

import com.google.common.base.Preconditions;

import org.apache.avro.generic.GenericData;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;

import java.io.IOException;

/**
 * InputFormat to generate and ingest Avro-based BigQuery exports.
 */
public class AvroBigQueryInputFormat
    extends AbstractBigQueryInputFormat {
  @Override
  public RecordReader createDelegateRecordReader(
      InputSplit split, Configuration configuration) throws IOException, InterruptedException {
    Preconditions.checkState(
        split instanceof FileSplit, "AvroBigQueryInputFormat requires FileSplit input splits");
    return new AvroRecordReader();
  }

  @Override
  public ExportFileFormat getExportFileFormat() {
    return ExportFileFormat.AVRO;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy