I am trying to retrieve table from BigQuery into Rstudio Server with the following:
project <- "my-project"
sql <- 'SELECT * FROM [my-project:dataset.table]'
data <- query_exec(sql, project = project, max_pages = Inf)
Error: Response too large to return. Consider setting allowLargeResults to true in your job configuration. For more details, see https://cloud.google.com/bigquery/querying-data#largequeryresults
I've checked "Allow Large Results" when configuring the table in the browser, still get the same error.
Used the following as well but without any success.
bq query --allow_large_results --destination_table=dataset.table1 "select x, y, z from dataset.table"
In general, when you get this error, you have to set
allowLargeResults
to true and specify a destination table. You can find the explanation in the link provided by the error message:In your case, I guess you are using the
bigrquery
package. If so, the functionquery_exec
has an optional argument calleddestination_table
, whose description is:In summary, using this argument you can provide a destination table (and implicitly set
allowLargeResults
to true), so you should use:Just keep in mind that you will create a new table called newtable in your dataset.