【发布时间】:2020-01-31 08:54:57
【问题描述】:
我想根据 BigTable 中的数据生成一些报告。为此,我想创建一个查询,该查询将从 BigTable 获取最新数据并将其传递到数据工作室报告中。现在的问题是,当我在 BigQuery 中创建 BigTable 连接时,我无法执行任何查询,即使在空表上也是如此。 我通过以下方式为 BigQuery 创建类型:
bq mk \
--external_table_definition=gs://somebucket/big-table-definition.json \
datareportingdataset.datareportingtable
命令执行成功。
我的big-table-definition.json 如下所示:
{
"sourceFormat": "BIGTABLE",
"sourceUris": [
"https://googleapis.com/bigtable/projects/playground-2/instances/data-reporting/tables/data-reporting-table"
],
"bigtableOptions": {
"readRowkeyAsString": "true",
"columnFamilies" : [
{
"familyId": "cf1",
"onlyReadLatest": "true",
"columns": [
{
"qualifierString": "temp",
"type": "STRING"
},
{
//the rest of the columns
]
}
]
}
}
执行简单的select * 查询时的错误如下所示:
Error while reading table: datareportingdataset.datareportingtable, error message: Error detected while parsing row starting at position: 2. Error: Data between close double quote (") and field separator.
首先我怀疑 BigTable 中有一些数据,但是当我从那里删除所有内容时,错误仍然存在。我发现它必须与 json 文件本身有关,因为当我将“sourceFormats”向下移动几行时,报告的错误更改位置。 我在这里做错了什么?
【问题讨论】:
标签: google-cloud-platform google-bigquery google-cloud-bigtable