Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bqr_grant_extract_access

Grant access to an extract on Google Cloud Storage


Description

To access the data created in bqr_extract_data. Requires the Google account email of the user.

Usage

bqr_grant_extract_access(extractJob, email)

Arguments

extractJob

An extract job from bqr_extract_data

email

email of the user to have access

Details

Value

URL(s) to download the extract that is accessible by email

See Also

Examples

## Not run: 
library(bigQueryR)

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

## make a big query
job <- bqr_query_asynch("your_project", 
                        "your_dataset",
                        "SELECT * FROM blah LIMIT 9999999", 
                        destinationTableId = "bigResultTable")
                        
## poll the job to check its status
## its done when job$status$state == "DONE"
bqr_get_job("your_project", job$jobReference$jobId)

##once done, the query results are in "bigResultTable"
## extract that table to GoogleCloudStorage:
# Create a bucket at Google Cloud Storage at 
# https://console.cloud.google.com/storage/browser

job_extract <- bqr_extract_data("your_project",
                                "your_dataset",
                                "bigResultTable",
                                "your_cloud_storage_bucket_name")
                                
## poll the extract job to check its status
## its done when job$status$state == "DONE"
bqr_get_job("your_project", job_extract$jobReference$jobId)

## to download via a URL and not logging in via Google Cloud Storage interface:
## Use an email that is Google account enabled
## Requires scopes:
##  https://www.googleapis.com/auth/devstorage.full_control
##  https://www.googleapis.com/auth/cloud-platform
## set via options("bigQueryR.scopes") and reauthenticate if needed

download_url <- bqr_grant_extract_access(job_extract, "your@email.com")

## download_url may be multiple if the data is > 1GB


## End(Not run)

bigQueryR

Interface with Google BigQuery with Shiny Compatibility

v0.5.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre], Hadley Wickham [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.