public class TestBigQuery
extends java.lang.Object
implements org.junit.rules.TestRule
Deletes the table on test shutdown.
Modifier and Type | Class and Description |
---|---|
static interface |
TestBigQuery.PollingAssertion
Interface to implement a polling assertion.
|
class |
TestBigQuery.RowsAssertion
Interface for creating a polling eventual assertion.
|
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
TestBigQuery.RowsAssertion |
assertThatAllRows(org.apache.beam.sdk.schemas.Schema rowSchema) |
static TestBigQuery |
create(org.apache.beam.sdk.schemas.Schema tableSchema)
Creates an instance of this rule.
|
java.util.List<org.apache.beam.sdk.values.Row> |
getFlatJsonRows(org.apache.beam.sdk.schemas.Schema rowSchema)
Loads rows from BigQuery into
Rows with given Schema . |
com.google.api.services.bigquery.model.TableDataInsertAllResponse |
insertRows(org.apache.beam.sdk.schemas.Schema rowSchema,
org.apache.beam.sdk.values.Row... rows) |
com.google.api.services.bigquery.model.TableReference |
tableReference() |
java.lang.String |
tableSpec() |
public static TestBigQuery create(org.apache.beam.sdk.schemas.Schema tableSchema)
Loads GCP configuration from TestPipelineOptions
.
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
@RequiresNonNull(value="table") public java.lang.String tableSpec()
@RequiresNonNull(value="table") public com.google.api.services.bigquery.model.TableReference tableReference()
@RequiresNonNull(value="table") public com.google.api.services.bigquery.model.TableDataInsertAllResponse insertRows(org.apache.beam.sdk.schemas.Schema rowSchema, org.apache.beam.sdk.values.Row... rows) throws java.io.IOException
java.io.IOException
public java.util.List<org.apache.beam.sdk.values.Row> getFlatJsonRows(org.apache.beam.sdk.schemas.Schema rowSchema)
Rows
with given Schema
.
Current implementation only supports flat Rows
and target Schemas
with Schema.FieldType.STRING
fields only.
public TestBigQuery.RowsAssertion assertThatAllRows(org.apache.beam.sdk.schemas.Schema rowSchema)