【发布时间】: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