0

我正在尝试在 Windows 命令行上创建一个传输作业

bq mk --transfer_config --data_source=amazon_s3 
--target_dataset=Usage --display_name='s3_transfer_installs_global_in_v0_test' 
--params='{"data_path_template":"mybucket", "destination_table_name_template":"in_table", "file_format":"CSV", "max_bad_records":"0", "skip_leading_rows":"1", "allow_jagged_rows":"false", "allow_quoted_newlines":"true", "access_key_id":"dfadfadf",  "secret_access_key":"sdfsfsdfsdf"}' 

但我不断收到错误的变化

Too many positional args, still have ['"allow_quoted_newlines":"true","access_key_id":',...

的输出--apilog也没有启发性。

我的 JSON 验证,但可能仍然需要转义字符?

非常感谢任何帮助,现在已经在引号和反斜杠周围改组了两个小时......

4

1 回答 1

0

运行查询时,我遇到了与您相同的错误。

我尝试在 --params 选项中用单引号替换双引号,它似乎正在工作。尝试以下操作:

bq mk --transfer_config --data_source=amazon_s3 --target_dataset=Usage --display_name='s3_transfer_installs_global_in_v0_test' --params="{'data_path_template':'mybucket', 'destination_table_name_template':'in_table', 'file_format':'CSV', 'max_bad_records':'0', 'skip_leading_rows':'1', 'allow_jagged_rows':'false', 'allow_quoted_newlines':'true', 'access_key_id':'dfadfadf',  'secret_access_key':'sdfsfsdfsdf'}"

我还尝试在 Windows PowerShell 中运行原始命令,它无需任何更改即可工作。

我认为问题出在Windows cmd ...

于 2020-12-14T22:31:20.567 回答