Parameters 在google dataproc上执行pig作业时,如何对逗号分隔的多个值使用params标志?

Parameters 在google dataproc上执行pig作业时,如何对逗号分隔的多个值使用params标志?,parameters,google-cloud-platform,gcloud,google-cloud-sdk,Parameters,Google Cloud Platform,Gcloud,Google Cloud Sdk,如何使用逗号分隔一个键来传递多个值 命令1: gcloud dataproc jobs submit pig--cluster msm-test-cluster -e "set;" --properties foo=bar --params bar=baz,bar1=(f1:chararray) 命令2: gcloud dataproc jobs submit pig--cluster msm-test-cluster -e "set;" --properties foo=bar --para

如何使用逗号分隔一个键来传递多个值

命令1:

gcloud dataproc jobs submit pig--cluster msm-test-cluster -e "set;" --properties foo=bar --params bar=baz,bar1=(f1:chararray)
命令2:

gcloud dataproc jobs submit pig--cluster msm-test-cluster -e "set;" --properties foo=bar --params bar=baz,bar1=(f1:chararray,f2:chararray,f3:chararray)
在上面的command1运行正常,但command2bar1有多个逗号分隔的值时,它失败了,因为chararray和f2之间有逗号。如何避开这个逗号。请参阅下面的错误消息。如果有人知道解决方案,请告诉我

**ERROR:** (gcloud.dataproc.jobs.submit.pig) argument --params: Bad syntax for dict arg: [id:chararray)]. Please see `gcloud topic flags-file` or `gcloud topic escaping` for information on providing list or dictionary flag values with special characters.
Usage: gcloud dataproc jobs submit pig --cluster=CLUSTER (--execute=QUERY, -e QUERY | --file=FILE, -f FILE) [optional flags]
  optional flags may be  --async | --bucket | --continue-on-failure |
                         --driver-log-levels | --execute | --file | --help |
                         --jars | --labels | --max-failures-per-hour |
                         --params | --properties | --region
有关此命令及其标志的详细信息

run:gcloud dataproc jobs submit pig --help
如图所示,您需要将任何逗号分隔的键值对封装在
[]
中。因此,像这样重新编写
gcloud
命令应该可以:

gcloud dataproc jobs submit pig--cluster msm-test-cluster -e "set;" --properties foo=bar --params=[bar=baz,bar1=(f1:chararray,f2:chararray,f3:chararray)]

应使用gcloud转义技术解决此问题。参考链接:

因此,命令可以按如下方式更新和执行:


gcloud dataproc jobs submit pig--cluster msm test cluster-e“set;”--properties foo=bar--params^^bar1=“(f1:chararray,f2:chararray,f3:chararray)”~bar=baz

我已经尝试了下面的命令,但仍然失败,出现下面的错误。gcloud dataproc jobs submit pig--cluster msm test cluster-e“set;”--properties foo=bar--params=[bar=baz,bar1=(f1:chararray,f2:chararray,f3:chararray)]错误:(gcloud.dataproc.jobs.submit.pig)参数--params:dict arg的语法错误:[f2:chararray]。请参阅
gcloud主题标志文件
gcloud主题转义
,了解有关使用特殊字符提供列表或词典标志值的信息。