Search in sources :

Example 1 with BigQueryDataSourceReaderModule

use of com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderModule in project spark-bigquery-connector by GoogleCloudDataproc.

the class BigQueryTableProvider method getTable.

@Override
public Table getTable(StructType schema, Transform[] partitioning, Map<String, String> properties) {
    Injector injector = createInjector(schema, properties, new BigQueryDataSourceReaderModule());
    BigQueryTable table = new BigQueryTable(injector.getInstance(BigQueryDataSourceReaderContext.class));
    return table;
}
Also used : BigQueryDataSourceReaderContext(com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderContext) Injector(com.google.inject.Injector) BigQueryDataSourceReaderModule(com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderModule)

Example 2 with BigQueryDataSourceReaderModule

use of com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderModule in project spark-bigquery-connector by GoogleCloudDataproc.

the class BigQueryDataSourceV2 method createReader.

@Override
public DataSourceReader createReader(StructType schema, DataSourceOptions options) {
    Injector injector = createInjector(schema, options.asMap(), new BigQueryDataSourceReaderModule());
    BigQueryDataSourceReader reader = new BigQueryDataSourceReader(injector.getInstance(BigQueryDataSourceReaderContext.class));
    return reader;
}
Also used : BigQueryDataSourceReaderContext(com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderContext) Injector(com.google.inject.Injector) BigQueryDataSourceReaderModule(com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderModule)

Aggregations

BigQueryDataSourceReaderContext (com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderContext)2 BigQueryDataSourceReaderModule (com.google.cloud.spark.bigquery.v2.context.BigQueryDataSourceReaderModule)2 Injector (com.google.inject.Injector)2