use of com.google.cloud.spark.bigquery.repackaged.com.google.cloud.bigquery.connector.common.BigQueryClient in project OpenLineage by OpenLineage.
the class MockBigQueryRelationProvider method createRelationInternal.
@Override
public BigQueryRelation createRelationInternal(SQLContext sqlContext, Map<String, String> parameters, Option<StructType> schema) {
Injector injector = INJECTOR.createGuiceInjector(sqlContext, parameters, schema);
SparkBigQueryConfig config = injector.getInstance(SparkBigQueryConfig.class);
BigQueryClient bigQueryClient = injector.getInstance(BigQueryClient.class);
TableInfo tableInfo = bigQueryClient.getReadTable(config.toReadTableOptions());
Dataset<Row> testRecords = injector.getInstance(new Key<Dataset<Row>>() {
});
return new MockBigQueryRelation(config, tableInfo, sqlContext, testRecords);
}
Aggregations