如何使用R将Google Cloud Datalab输出保存到BigQuery中

问题描述 投票:1回答:1

我在Google Cloud Datalab中使用R,我想将我的输出(这是一个包含在代码本身中创建的字符串的表)保存到BigQuery。我知道有一种方法可以通过使用bqr_create_table来使用Python,所以我在寻找R中的等价物。

sql r google-cloud-platform google-bigquery
1个回答
1
投票

我在Google Cloud Platform上找到了来自Gus Class的blog post,它使用此代码写入BigQuery:

# Install BigRQuery if you haven't already...
# install.packages("devtools")
# devtools::install_github("rstats-db/bigrquery")
# library(bigrquery)
insert_upload_job("your-project-id", "test_dataset", "stash", stash)

其中"test_dataset"是BigQuery中的数据集,"stash"是数据集中的表,stash是您使用数据定义的任何数据帧。

有关如何使用bigrquery进行授权的更多信息

© www.soinside.com 2019 - 2024. All rights reserved.