bqr_download_query: Download data from BigQuery to local folder

Description Usage Arguments Value Examples

View source: R/fastBqDownload.R

Description

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

Usage

1
2
3
4
5
6
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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`")


## End(Not run)

bigQueryR documentation built on Oct. 9, 2019, 5:05 p.m.