Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 71f9f55

Browse files
authoredMar 27, 2023
fix: QueryWithStructsParameters sample mismatch (#2610)
1 parent 4ff4c70 commit 71f9f55

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ public static void queryWithStructsParameters() {
4040

4141
// Create struct
4242
Map<String, QueryParameterValue> struct = new HashMap<>();
43-
struct.put("booleanField", QueryParameterValue.bool(true));
44-
struct.put("integerField", QueryParameterValue.string("test-stringField"));
45-
struct.put("stringField", QueryParameterValue.int64(10));
43+
struct.put("x", QueryParameterValue.int64(1));
44+
struct.put("y", QueryParameterValue.string("foo"));
4645
QueryParameterValue recordValue = QueryParameterValue.struct(struct);
4746

48-
String query = "SELECT STRUCT(@recordField) AS record";
47+
String query = "SELECT STRUCT(@recordField) AS s";
4948
QueryJobConfiguration queryConfig =
5049
QueryJobConfiguration.newBuilder(query)
51-
.setUseLegacySql(false)
5250
.addNamedParameter("recordField", recordValue)
5351
.build();
5452

0 commit comments

Comments
 (0)
Failed to load comments.