code: public void runQueryWithArrayParameters() throws InterruptedException {
      // [START bigquery_query_params_arrays]
      // BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
      String gender = "M";
      String[] states = {"WA", "WI", "WV", "WY"};
      String query =
          "SELECT name, sum(number) as count\n"
              + "FROM `bigquery-public-data.usa_names.usa_1910_2013`\n"
              + "WHERE gender = @gender\n"
              + "AND state IN UNNEST(@states)\n"
              + "GROUP BY name\n"
              + "ORDER BY count DESC\n"
              + "LIMIT 10;";
      // Note: Standard SQL is required to use query parameters.
      QueryJobConfiguration queryConfig =
          QueryJobConfiguration.newBuilder(query)
              .addNamedParameter("gender", QueryParameterValue.string(gender))
              .addNamedParameter("states", QueryParameterValue.array(states, String.class))
              .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_params_arrays]
    }
docs: Example of running a query with array query parameters.