From ccfdd61b54cfd8b73e44d665bbdb2b3dc1da1bdb Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Mon, 11 Jun 2018 13:44:01 -0700 Subject: [PATCH] Removes old sample (#3364) * Removes old sample bigquery_query_standard has been removed because it is no longer being used in the docs. (a combination of bigquery_query and bigquery_query_legacy are being used instead) * Removes bigquery_query_standard test --- .../bigquery/snippets/CloudSnippets.java | 21 ------------------- .../bigquery/snippets/ITCloudSnippets.java | 7 ------- 2 files changed, 28 deletions(-) diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/CloudSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/CloudSnippets.java index 77ffa2f133f2..1d910ac87e78 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/CloudSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/CloudSnippets.java @@ -71,27 +71,6 @@ public void runLegacySqlQuery() throws InterruptedException { // [END bigquery_query_legacy] } - /** - * Example of running a query with Standard SQL explicitly set. - */ - public void runStandardSqlQuery() throws InterruptedException { - // [START bigquery_query_standard] - // BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); - String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; - QueryJobConfiguration queryConfig = - // Note that setUseLegacySql is set to false by default - QueryJobConfiguration.newBuilder(query).setUseLegacySql(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_standard] - } - /** * Example of running a query and saving the results to a table. */ diff --git a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITCloudSnippets.java b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITCloudSnippets.java index fbd7b3667d1d..08dd9289ef43 100644 --- a/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITCloudSnippets.java +++ b/google-cloud-examples/src/test/java/com/google/cloud/examples/bigquery/snippets/ITCloudSnippets.java @@ -62,13 +62,6 @@ public void testRunLegacySqlQuery() throws InterruptedException { assertTrue(got.contains("romeoandjuliet")); } - @Test - public void testRunStandardSqlQuery() throws InterruptedException { - cloudSnippets.runStandardSqlQuery(); - String got = bout.toString(); - assertTrue(got.contains("romeoandjuliet")); - } - @Test public void testRunQueryPermanentTable() throws InterruptedException { String tableName = "test_destination_table";