Skip to content

Commit

Permalink
docs(samples): address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Praful Makani committed Dec 1, 2020
1 parent e4c0513 commit eb1cebe
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -19,8 +19,6 @@
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQueryException;
import com.google.cloud.bigquery.BigQueryOptions;
import com.google.cloud.bigquery.Job;
import com.google.cloud.bigquery.JobInfo;
import com.google.cloud.bigquery.QueryJobConfiguration;
import com.google.cloud.bigquery.TableResult;

Expand All @@ -40,8 +38,7 @@ public static void queryMaterializedView(String query) throws InterruptedExcepti
// once, and can be reused for multiple requests.
BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();

Job job = bigquery.create(JobInfo.of(QueryJobConfiguration.of(query)));
TableResult results = job.getQueryResults(BigQuery.QueryResultsOption.pageSize(1000));
TableResult results = bigquery.query(QueryJobConfiguration.of(query));
results
.iterateAll()
.forEach(row -> row.forEach(val -> System.out.printf("%s\n", val.toString())));
Expand Down

0 comments on commit eb1cebe

Please sign in to comment.