我是BigQuery的新手,我试图使用BASH文件创建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"
}
]
我正在使用following文档和命令作为参考:
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
有什么解决方案?预先感谢。
答案 0 :(得分:0)
在第一个命令中,您将JSON
文件定义为temp_schema.json
,但是在第二个bq mk
命令中,您将其命名为myschema.json
,我相信您应该指出改为myschema.json
的位置。