【发布时间】:2020-12-25 15:39:43
【问题描述】:
我是 Google Cloud CLI 的新手,很抱歉这个愚蠢的问题,但这真的很烦人。
我正在尝试执行这个命令:
bq mk --transfer_config --target_dataset=ds_scrummate --display_name='map_email' --data_source=amazon_s3 --params='{"data_path_template":"s3://sm-bigquery/map_email/{run_date}/*.csv", "destination_table_name_template":"ing_map_email", "file_format":"CSV", "max_bad_records":"0", "ignore_unknown_values":"true", "field_delimiter":",", "skip_leading_rows":"1", "allow_quoted_newlines":"true", "allow_jagged_rows":"false", "delete_source_files":"true"}'
我总是收到此错误消息:
BigQuery error in mk operation: Parameters should be specified in JSON format
when creating the transfer configuration.
上面的 JSON 文件似乎是有效的(我已经使用在线验证器对其进行了测试)。 我也试过这个命令的多行版本,结果相同。
问题:
- 我做错了什么?尽管内容经过验证,为什么我会在此处收到 JSON 错误?
- 如何获得更详细的错误信息?此命令是否有我找不到的详细标志?
- 为什么没有任何好的文档详细描述此类错误?
我使用过的来源:
https://cloud.google.com/bigquery/docs/reference/bq-cli-reference#bq_mkhttps://cloud.google.com/bigquery-transfer/docs/working-with-transfershttps://cloud.google.com/bigquery-transfer/docs/s3-transfer#bqhttps://cloud.google.com/bigquery/docs/bq-command-line-tool
【问题讨论】:
-
我尝试运行您粘贴的相同命令,但没有收到与您相同的错误(至少
--params=是有效的)。我怀疑您的 CLI 环境是否有问题,或者您的 JSON 中有一些不可见的特殊字符。如果我是你,我会从--params=simple 开始,里面只有一个参数来查看它何时变为无效 JSON。
标签: google-bigquery command-line-interface documentation gcloud bq