This repository was archived by the owner on Mar 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
samples/snippets/src/main/java/com/example/bigquery Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030// This feature is controlled by setting the defaultJobCreationMode
3131// field in the BigQueryOptions used for the client. JOB_CREATION_OPTIONAL
3232// allows for the execution of queries without creating a job.
33- public class QueryShortMode {
33+ public class QueryJobOptional {
3434
3535 public static void main (String [] args ) {
3636 String query =
3737 "SELECT name, gender, SUM(number) AS total FROM "
3838 + "bigquery-public-data.usa_names.usa_1910_2013 GROUP BY "
3939 + "name, gender ORDER BY total DESC LIMIT 10" ;
40- queryShortMode (query );
40+ queryJobOptional (query );
4141 }
4242
43- public static void queryShortMode (String query ) {
43+ public static void queryJobOptional (String query ) {
4444 try {
4545 // Initialize client that will be used to send requests. This client only needs
4646 // to be created once, and can be reused for multiple requests.
4747 BigQueryOptions options = BigQueryOptions .getDefaultInstance ();
48- options .setDefaultJobCreationMode (JobCreationMode .JOB_CREATION_OPTIONAL );
48+ options .setDefaultJobCreationMode (QueryJobConfiguration . JobCreationMode .JOB_CREATION_OPTIONAL );
4949 BigQuery bigquery = options .getService ();
5050
5151 // Execute the query. The returned TableResult provides access information
You can’t perform that action at this time.
0 commit comments