I'm working in an R ipython notebook (relative R newbie) and trying to extract data from Google Big Query using 'bigrquery'. I'm told this should be simple, but extracting using standard sql isn't working.
Here's my code:
# Use your project ID here
project <- "project-id" # put your project ID here
standard_sql <- "SELECT year, month, day, weight_pounds FROM `publicdata.samples.natality` LIMIT 5"
legacy_sql <- "SELECT year, month, day, weight_pounds FROM [publicdata:samples.natality] LIMIT 5"
# doesn't work
standard_data <- query_exec(standard_sql, project = project, useLegacySql = FALSE)
legacy_data <- query_exec(legacy_sql, project = project, useLegacySql = TRUE)
Error: Invalid table name: `publicdata:samples.natality`
1. query_exec(standard_sql, project = project, useLegacySql = FALSE)
2. run_query_job(query = query, project = project, destination_table = destination_table,
. default_dataset = default_dataset, create_disposition = create_disposition,
. write_disposition = write_disposition, use_legacy_sql = use_legacy_sql,
. quiet = quiet, ...)
3. wait_for(job, quiet = quiet)
4. stop(err$message, call. = FALSE)
You sent the wrong variable to the function.
It should be
use_legacy_sql = FALSE instead of
useLegacySql. They changed the variable name right after committing the new code.