/** Example of running a query with the cache disabled. */ public void runUncachedQuery() throws TimeoutException, InterruptedException { // [START bigquery_query_no_cache] // BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query) // Disable the query cache to force live query evaluation. .setUseQueryCache(false) .build(); // Print the results. for (FieldValueList row : bigquery.query(queryConfig).iterateAll()) { for (FieldValue val : row) { System.out.printf("%s,", val.toString()); } System.out.printf("\n"); } // [END bigquery_query_no_cache] }