public final class BigQueryTestUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static com.google.cloud.bigquery.Schema |
createSchema(java.lang.String idColumn,
int numFields,
int maxEntryLength)
Utility method to create a schema based on the given constraints.
|
static com.google.cloud.Tuple<com.google.cloud.bigquery.Schema,java.util.List<com.google.cloud.bigquery.InsertAllRequest.RowToInsert>> |
generateBigQueryTable(java.lang.String idColumn,
int numRows,
int numFields,
int maxEntryLength)
Generate data to be persisted to a BigQuery table for testing.
|
static java.util.List<com.google.cloud.bigquery.InsertAllRequest.RowToInsert> |
generateRandomData(com.google.cloud.bigquery.Schema schema,
java.lang.String idColumn,
int numRows,
int maxEntryLength)
Utility method to generate random data for a given schema.
|
public static com.google.cloud.Tuple<com.google.cloud.bigquery.Schema,java.util.List<com.google.cloud.bigquery.InsertAllRequest.RowToInsert>> generateBigQueryTable(java.lang.String idColumn, int numRows, int numFields, int maxEntryLength)
idColumn
- Column name containing the ID.numRows
- Number of rows to generate.numFields
- Number of fields in the schema.maxEntryLength
- Maximum length for each field. Please note that maxEntryLength can not
exceed 300 characters.public static com.google.cloud.bigquery.Schema createSchema(java.lang.String idColumn, int numFields, int maxEntryLength)
idColumn
- Name of the id column to use.numFields
- Number of fields.maxEntryLength
- Maximum entry.public static java.util.List<com.google.cloud.bigquery.InsertAllRequest.RowToInsert> generateRandomData(com.google.cloud.bigquery.Schema schema, java.lang.String idColumn, int numRows, int maxEntryLength)
schema
- Schema to generate the data for.idColumn
- The name of the id column.numRows
- Number of rows to create.maxEntryLength
- Size of strings to use.InsertAllRequest.RowToInsert
list.