Class RemoteBigQueryHelper


  • public class RemoteBigQueryHelper
    extends Object
    Utility to create a remote BigQuery configuration for testing. BigQuery options can be obtained via the getOptions() method. Returned options have custom ServiceOptions.getRetrySettings(): RetrySettings.getMaxAttempts() is 10, RetrySettings.getMaxRetryDelay() is 30000, RetrySettings.getTotalTimeout() is 120000 and RetrySettings.getInitialRetryDelay() is 250. HttpTransportOptions.getConnectTimeout() and HttpTransportOptions.getReadTimeout() are both set to 60000.
    • Method Detail

      • forceDelete

        public static boolean forceDelete​(BigQuery bigquery,
                                          String dataset)
        Deletes a dataset, even if non-empty.
        Parameters:
        bigquery - the BigQuery service to be used to issue the delete request
        dataset - the dataset to be deleted
        Returns:
        true if deletion succeeded, false if the dataset was not found
        Throws:
        BigQueryException - upon failure
      • generateDatasetName

        public static String generateDatasetName()
        Returns a dataset name generated using a random UUID.
      • generateModelName

        public static String generateModelName()
      • generateRoutineName

        public static String generateRoutineName()
      • create

        public static RemoteBigQueryHelper create()
        Creates a RemoteBigQueryHelper object using default project id and authentication credentials.