Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down