use of org.apache.beam.sdk.io.gcp.bigquery.BigQueryHelpers.JsonSchemaToTableSchema in project beam by apache.
the class BigQueryIOTest method testRuntimeOptionsNotCalledInApplyOutput.
@Test
public void testRuntimeOptionsNotCalledInApplyOutput() {
RuntimeTestOptions options = PipelineOptionsFactory.as(RuntimeTestOptions.class);
BigQueryOptions bqOptions = options.as(BigQueryOptions.class);
bqOptions.setTempLocation("gs://testbucket/testdir");
Pipeline pipeline = TestPipeline.create(options);
BigQueryIO.Write<TableRow> write = BigQueryIO.writeTableRows().to(options.getOutputTable()).withSchema(NestedValueProvider.of(options.getOutputSchema(), new JsonSchemaToTableSchema())).withoutValidation();
pipeline.apply(Create.empty(TableRowJsonCoder.of())).apply(write);
// Test that this doesn't throw.
DisplayData.from(write);
}
Aggregations