Я создал файл json для определения таблицы в Google bigQuery, которая связана с электронной таблицей Google Sheets:
{
"autodetect": true,
"sourceFormat": "GOOGLE_SHEETS",
"sourceUris": [
"https://docs.google.com/spreadsheets/d/1P1WH7cwVDaG6k-OQxKVXtnjBXI1NGFYvHD6IxCRFsZc"
],
"maxBadRecords": 1,
"googleSheetsOptions":
{
"range": "Sheet2!A1:B10",
"skipLeadingRows": 0
},
"schema" : {
"fields": [
{"name":"col3","type":"string"},
{"name":"col4","type":"string"}
]
}
}
Когда я запрашиваю его с помощью этой командной строки bq:
bq query --external_table_definition="Sheet2::/home/avilella/LIMS/test.json" --format=csv --use_legacy_sql=false 'SELECT * FROM Sheet2'
Я получаю эту ошибку:
BigQuery error in query operation: Error processing job 'cegx-test-project1:bqjob_r30ad5155bcd0a174_00000163bb575bcf_1': Error while reading table: Sheet2, error message: Sheets table encountered too many
errors, giving up. Rows: 2; errors: 2. Please look into the error stream for more details.
Failure details:
- 1P1WH7cwVDaG6k-OQxKVXtnjBXI1NGFYvHD6IxCRFsZc: Error while reading
data, error message: Row 1 has only 1 columns, while 2 is needed.
- 1P1WH7cwVDaG6k-OQxKVXtnjBXI1NGFYvHD6IxCRFsZc: Error while reading
data, error message: Row 2 has only 1 columns, while 2 is needed.
Есть идеи, что я делаю не так?