首页 > 解决方案 > 如何将数据从连接到 Google 表格的 BigQuery 表中提取到 R 中

问题描述

我已成功从来自 CSV 的 BigQuery 表中提取数据。但是,当我尝试使用相同的步骤从来自 Google 表格的 BigQuery 中提取数据时,我收到以下错误:

Error: Error while reading table: testprojectanintroductiontogcp.Demo.SheetsDemo, error message: Failed to read the spreadsheet. Error code: PERMISSION_DENIED [invalid] 

这是我的代码:

project_id <- "testprojectanintroductiontogcp"
sql_string <- "SELECT * FROM testprojectanintroductiontogcp.Demo.SheetsDemo LIMIT 5"
query_results <- query_exec(sql_string, project = project_id, useLegacySql = FALSE)

readrbigrquery安装软件包。

如何访问来自 Google 表格的数据表?

标签: sqlrgoogle-sheetsgoogle-bigquery

解决方案


推荐阅读