Class TestBigQuery
java.lang.Object
org.apache.beam.sdk.io.gcp.bigquery.TestBigQuery
- All Implemented Interfaces:
TestRule
Test rule which creates a new table with specified schema, with randomized name and exposes few
APIs to work with it.
Deletes the table on test shutdown.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface to implement a polling assertion.class
Interface for creating a polling eventual assertion. -
Method Summary
Modifier and TypeMethodDescriptionapply
(Statement base, Description description) assertThatAllRows
(Schema rowSchema) static TestBigQuery
Creates an instance of this rule.getFlatJsonRows
(Schema rowSchema) insertRows
(Schema rowSchema, Row... rows)
-
Method Details
-
create
Creates an instance of this rule.Loads GCP configuration from
TestPipelineOptions
. -
apply
-
tableSpec
-
tableReference
-
insertRows
@RequiresNonNull("table") public TableDataInsertAllResponse insertRows(Schema rowSchema, Row... rows) throws IOException - Throws:
IOException
-
getFlatJsonRows
Loads rows from BigQuery intoRows
with givenSchema
.Current implementation only supports flat
Rows
and targetSchemas
withSchema.FieldType.STRING
fields only. -
assertThatAllRows
-