【问题标题】:Give Simba ODBC driver or bigrquery access to Google Drive files授予 Simba ODBC 驱动程序或 bigrquery 访问 Google Drive 文件的权限
【发布时间】:2018-03-07 01:54:36
【问题描述】:

我正在尝试将基于 Google 电子表格的 BQ 表加载到统计数据包 Stata 中。我尝试了两种方法来实现这一点。

首先,我使用了 Mac 版 Simba ODBC 驱动程序(版本 2.1.6),但出现以下错误:

The ODBC driver reported the following diagnostics
[Simba][BigQuery] (20) Query execution failed: Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found.
SQLSTATE=HY000

在我的 odbc.ini 文件中,我设置了 RequestGoogleDriveScope=1,并且正在使用 OAuth 机制的用户身份验证。我可以在 BQ Web UI 中查询这个表,我可以通过 ODBC 加载其他非 GS 表。

其次,我想也许我可以在 R 中执行此操作,绕过 Simba/ODBC:

library(bigrquery)
data <- query_exec("SELECT * FROM my_table;", project = "XXXX", useLegacySql = FALSE)
Error: Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found.

总而言之,此查询适用于 BQ Web UI,不适用于 R(使用 API)或 Stata(使用 ODBC)。共同点是 Stata 或 R 在https://myaccount.google.com/permissions 中都没有 google 驱动器权限,而 BQ 客户端工具拥有它们。这是我对问题所在的最佳猜测。任何有关如何更改 OAuth 范围的建议都将不胜感激。

交叉发布on Statalist

【问题讨论】:

    标签: r google-sheets odbc google-bigquery stata


    【解决方案1】:

    这是 bigrquery 的 OAuth2 主题。该应用程序通常需要访问工作表(Google Drive 范围),但它没有在身份验证过程中请求该范围。 bigrquery 的开发人员只是决定不这样做。

    这里讨论了这个问题:https://github.com/r-dbi/bigrquery/issues/132,似乎超出了他们的范围。

    一种可能的解决方法(虽然未经测试):

    【讨论】:

    • 有没有办法在 ODBC 路由中解决这个问题?
    • 基本上是一样的,因为 Google 总是使用 OAuth2 - 您需要配置驱动程序,以便它要求 Google Drive 范围。这是 OAAuth2 Google 服务的游乐场 - 也许这可以帮助您澄清概念:developers.google.com/oauthplayground
    • 感谢您向我解释这一点,但这不是我在 odbc.ini 中使用 RequestGoogleDriveScope=1 设置所做的吗?
    猜你喜欢
    • 1970-01-01
    • 2020-12-28
    • 2020-10-11
    • 2011-03-08
    • 2020-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多