com.google.cloud.hadoop.io.bigquery.GsonBigQueryInputFormat Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bigquery-connector Show documentation
Show all versions of bigquery-connector Show documentation
Hadoop 2 MapReduce input and output formats for use with BigQuery
package com.google.cloud.hadoop.io.bigquery;
import com.google.cloud.hadoop.util.LogUtil;
import com.google.gson.JsonObject;
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 java.io.IOException;
/**
* GsonBigQueryInputFormat provides access to BigQuery tables via exports to GCS in the form of
* gson JsonObjects as mapper values.
*/
public class GsonBigQueryInputFormat
extends AbstractBigQueryInputFormat {
protected static final LogUtil log = new LogUtil(GsonBigQueryInputFormat.class);
@Override
public RecordReader createDelegateRecordReader(
InputSplit split, Configuration configuration) throws IOException, InterruptedException {
log.debug("createDelegateRecordReader -> new GsonRecordReader");
return new GsonRecordReader();
}
@Override
public ExportFileFormat getExportFileFormat() {
return ExportFileFormat.LINE_DELIMITED_JSON;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy