【问题标题】:bigquery googleSheetsOptions range in Apps ScriptApps 脚本中的 bigquery googleSheetsOptions 范围
【发布时间】:2019-01-06 20:15:16
【问题描述】:

类似于bq 命令行,在 Apps Script (externalDataConfiguration.googleSheetsOptions.range) 中定义 bigquery 查询时是否可以使用 bigquery googleSheetsOptions range

https://cloud.google.com/bigquery/docs/reference/rest/v2/tables

例如,给定如下表定义 google_sheets_tabeledef.json,我可以将此表定义作为 Apps 脚本中的 bigquery 方法传递吗?

{
  "autodetect": false,
  "sourceFormat": "GOOGLE_SHEETS", 
  "sourceUris": [
    "https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxx"
  ],
  "maxBadRecords": 1,
  "googleSheetsOptions":
  {
    "range": "test_sheet!A1:B20",
    "skipLeadingRows": 0
  },
  "schema" : {
    "fields": [
      {
        "name": "col1",
        "type": "string"
      },
      {
        "name": "col2",
        "type": "int64"
      },
    ]
  }
}

相关问题: bigQuery Google Drive query multiple sheets with googleSheetsOptions range

【问题讨论】:

  • @li-tan 一个有关 googleSheetsOptions range 的相关问题,这次是在 Apps 脚本中。
  • 能否提供一个用例。目前尚不清楚您要做什么。您可以从 AppScript 访问 BigQuery API 并管理您的 BigQuery 数据集和表。您可以使用该表定义在表中加载数据。

标签: google-apps-script google-sheets google-cloud-platform google-bigquery google-sheets-api


【解决方案1】:

我相信现在(答案写于 2019 年 8 月)已添加到 bigQuery 中的表定义中。所以当通过网页定义表格时,现在有一个范围部分,如下图所示:

specify range in BigQuery Google Sheets table connector

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多