I try to test my first Dataflow app by running it in Eclipse.
我尝试通过在Eclipse中运行它来测试我的第一个Dataflow应用程序。
When I try to pass 4 values for the arguments on "Run Configuration" on "Arguments" tab as following:
当我尝试在“参数”选项卡上的“运行配置”上为参数传递4个值时,如下所示:
projects/poc/subscriptions/poc-TestApp1 poc myDataSet my_logs
I get the error:
我收到错误:
Argument 'projects/poc/subscriptions/poc-TestApp1' does not begin with '--'
参数'projects / poc / subscriptions / poc-TestApp1'不以' - '开头
adding --
to all arguments produced a different error.
添加 - 对所有参数产生不同的错误。
1 个解决方案
#1
1
Based on your question, it seems that you have custom argument parsing code in your program (I suppose you're extracting your arguments as args[0]
, args[1]
etc. in your main()
function?), but still use PipelineOptionsFactory.fromArgs(args)
to configure the options for Dataflow itself.
基于你的问题,似乎你的程序中有自定义参数解析代码(我想你在main()函数中将你的参数提取为args [0],args [1]等?),但仍然使用PipelineOptionsFactory.fromArgs(args)为Dataflow本身配置选项。
Dataflow does not support this mixed way of specifying command-line arguments - you need to define your own PipelineOptions to represent your configuration parameters, and specify them prefixed with --
.
Dataflow不支持这种指定命令行参数的混合方式 - 您需要定义自己的PipelineOptions来表示配置参数,并指定它们前缀为 - 。
Please see here for details, in particular here for creating custom options.
有关详细信息,请参阅此处,尤其是创建自定义选项。
#1
1
Based on your question, it seems that you have custom argument parsing code in your program (I suppose you're extracting your arguments as args[0]
, args[1]
etc. in your main()
function?), but still use PipelineOptionsFactory.fromArgs(args)
to configure the options for Dataflow itself.
基于你的问题,似乎你的程序中有自定义参数解析代码(我想你在main()函数中将你的参数提取为args [0],args [1]等?),但仍然使用PipelineOptionsFactory.fromArgs(args)为Dataflow本身配置选项。
Dataflow does not support this mixed way of specifying command-line arguments - you need to define your own PipelineOptions to represent your configuration parameters, and specify them prefixed with --
.
Dataflow不支持这种指定命令行参数的混合方式 - 您需要定义自己的PipelineOptions来表示配置参数,并指定它们前缀为 - 。
Please see here for details, in particular here for creating custom options.
有关详细信息,请参阅此处,尤其是创建自定义选项。