Skip to contents

Executes a SQL query against Google BigQuery and returns the result as a tidylearn_data object. Requires the bigrquery package and valid Google Cloud authentication.

Usage

tl_read_bigquery(project, query, dataset = NULL, ...)

Arguments

project

Google Cloud project ID, or a bigquery://project/dataset URI, whose dataset is used when dataset is not given.

query

A SQL query string (Standard SQL).

dataset

Optional default dataset for unqualified table names, in project.

...

Additional arguments passed to bigrquery::bq_project_query().

Value

A tidylearn_data object containing the query results.

Examples

if (FALSE) { # \dontrun{
# Needs Google Cloud credentials
tl_read_bigquery(
  project = "my-project",
  query = "SELECT * FROM `my_dataset.my_table` LIMIT 1000"
)

# Unqualified table names resolve against `dataset`
tl_read_bigquery(
  project = "my-project",
  query = "SELECT * FROM my_table LIMIT 1000",
  dataset = "my_dataset"
)
} # }