public class BigQueryUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
POLL_WAIT_INITIAL_MILLIS |
static int |
POLL_WAIT_INTERVAL_MAX_MILLIS |
static int |
POLL_WAIT_MAX_ELAPSED_MILLIS |
Constructor and Description |
---|
BigQueryUtils() |
Modifier and Type | Method and Description |
---|---|
static List<com.google.api.services.bigquery.model.TableFieldSchema> |
getSchemaFromString(String fields)
Parses the given JSON string and returns the extracted schema.
|
static void |
waitForJobCompletion(com.google.api.services.bigquery.Bigquery bigquery,
String projectId,
com.google.api.services.bigquery.model.JobReference jobReference,
org.apache.hadoop.util.Progressable progressable)
Polls job until it is completed.
|
public static final int POLL_WAIT_INITIAL_MILLIS
public static final int POLL_WAIT_INTERVAL_MAX_MILLIS
public static final int POLL_WAIT_MAX_ELAPSED_MILLIS
public static void waitForJobCompletion(com.google.api.services.bigquery.Bigquery bigquery, String projectId, com.google.api.services.bigquery.model.JobReference jobReference, org.apache.hadoop.util.Progressable progressable) throws IOException, InterruptedException
bigquery
- the Bigquery instance to poll.projectId
- the project that is polling.jobReference
- the job to poll.progressable
- to get progress of task.IOException
- on IO Error.InterruptedException
- on sleep interrupt.public static List<com.google.api.services.bigquery.model.TableFieldSchema> getSchemaFromString(String fields)
fields
- a string to read the TableSchema from.Copyright © 2020. All rights reserved.