Learn R Programming

bigQueryR (version 0.5.0)

bqr_download_query: Download data from BigQuery to local folder

Description

Requires you to make a bucket at https://console.cloud.google.com/storage/browser

Usage

bqr_download_query(query = NULL, target_folder = "data",
  result_file_name = NULL, refetch = FALSE, useLegacySql = FALSE,
  clean_intermediate_results = TRUE,
  global_project_name = bqr_get_global_project(),
  global_dataset_name = bqr_get_global_dataset(),
  global_bucket_name = googleCloudStorageR::gcs_get_global_bucket())

Arguments

query

The query you want to run.

target_folder

Target folder on your local computer.

result_file_name

Name of your downloaded file.

refetch

Boolean, whether you would like to refetch previously downloaded data.

useLegacySql

Boolean, whether to use Legacy SQL. Default is FALSE.

clean_intermediate_results

Boolean, whether to keep intermediate files on BigQuery and Google Cloud Storage.

global_project_name

BigQuery project name (where you would like to save your file during download).

global_dataset_name

BigQuery dataset name (where you would like to save your file during download).

global_bucket_name

Google Cloud Storage bucket name (where you would like to save your file during download).

Value

a data.table.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
library(bigQueryR)

## Auth with a project that has at least BigQuery and Google Cloud Storage scope
bqr_auth()

# Create a bucket at Google Cloud Storage at 
# https://console.cloud.google.com/storage/browser

bqr_download_query(query = "select * from `your_project.your_dataset.your_table`")

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab