BigQuery 命令'bq mk'引发错误"BigQuery error in mk operation: Error reading schema:"



我是BigQuery的新手,我正在尝试使用MASH文件创建BigQuery表,该文件是从Cloud Shell运行的。该文件包含以下bq mk命令:

bq mk --table project_id:dataset_name.table_name /home/bhagesharora/temp_schema.json

temp_schema.json内容:

[
{
"description": "quarter",
"mode": "REQUIRED",
"name": "qtr",
"type": "STRING"
},
{
"description": "sales representative",
"mode": "NULLABLE",
"name": "rep",
"type": "STRING"
},
{
"description": "total sales",
"mode": "NULLABLE",
"name": "sales",
"type": "FLOAT"
}
]

我使用以下文档和命令作为参考:

bq mk --table mydataset.mytable ./myschema.json

我得到的完整错误是:

BigQuery error in mk operation: Error reading schema: "/home/bhagesharora/temp_schema.json
" looks like a filename, but was not found.
bq_create_eventTables.sh: line 2: $'r': command not found
bq_create_eventTables.sh: line 3: $'r': command not found
bq_create_eventTables.sh: line 4: $'r': command not found
bq_create_eventTables.sh: line 5: $'r': command not found

解决方案是什么?提前谢谢。

在第一个命令中,您将JSON文件定义为temp_schema.json但在第二个bq mk命令中,您将其命名为myschema.json,我相信您应该将其指向myschema.json的位置。

最新更新