I want to generate some reports based on the data in BigTable. For that I wanted to create a query which will get the latest data from the BigTable and pass it over onto the data studio report. Now the problem is that when I create a BigTable connection in BigQuery I cannot execute any query, even on the empty table. I create the type for BigQuery in the following way:
bq mk \
--external_table_definition=gs://somebucket/big-table-definition.json \
datareportingdataset.datareportingtable
and the command executes successfully.
My big-table-definition.json
looks like the following:
{
"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
]
}
]
}
}
The error when doing simple select *
query looks like the following:
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.
First I was suspecting some data in the BigTable but when I deleted everything from there the error still occurs. I have found out that it must be something with the json file itself as when I move the "sourceFormats" down a few lines the error changes position reported. What am I doing wrong here?