Apps脚本中的bigquery googleSheetsOptions范围

时间:2018-07-30 14:31:04

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

类似于bq命令行,在Apps脚本(externalDataConfiguration.googleSheetsOptions.range)中定义bigquery查询时,可以使用bigquery googleSheetsOptions range吗?

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

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

{
  "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

1 个答案:

答案 0 :(得分:0)

我认为现在(答案为2019年8月)已添加到bigQuery的表定义中。因此,当通过网页定义表格时,现在有一个范围部分,如下面的屏幕截图所示:

specify range in BigQuery Google Sheets table connector