Skip to content

Commit

Permalink
fix: QueryWithStructsParameters sample mismatch (#2610)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan0102 committed Mar 27, 2023
1 parent 4ff4c70 commit 71f9f55
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -40,15 +40,13 @@ public static void queryWithStructsParameters() {

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

String query = "SELECT STRUCT(@recordField) AS record";
String query = "SELECT STRUCT(@recordField) AS s";
QueryJobConfiguration queryConfig =
QueryJobConfiguration.newBuilder(query)
.setUseLegacySql(false)
.addNamedParameter("recordField", recordValue)
.build();

Expand Down

0 comments on commit 71f9f55

Please sign in to comment.