Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for parameterized-queries in bqfrag #53

Open
ingarabr opened this issue Apr 19, 2023 · 0 comments
Open

add support for parameterized-queries in bqfrag #53

ingarabr opened this issue Apr 19, 2023 · 0 comments

Comments

@ingarabr
Copy link
Contributor

https://cloud.google.com/bigquery/docs/parameterized-queries

 String query =
  "SELECT word, word_count\n"
    + "FROM `bigquery-public-data.samples.shakespeare`\n"
    + "WHERE corpus = @corpus\n"
    + "AND word_count >= @min_word_count\n"
    + "ORDER BY word_count DESC";

QueryJobConfiguration queryConfig =
  QueryJobConfiguration.newBuilder(query)
     .addNamedParameter("corpus", QueryParameterValue.string(corpus))
     .addNamedParameter("min_word_count", QueryParameterValue.int64(minWordCount))
     .build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant