简体   繁体   English

文件作为命令行参数在 Oozie 工作流中触发操作

[英]File as command line argument to spark action in Oozie workflow

How to pass a file as command line argument to spark job in Oozie workflow?如何将文件作为命令行参数传递给 Oozie 工作流中的 Spark 作业? My spark job is expecting a file as command line argument, but when I am pass that file in the workflow as /file/location it is not picking up that file.我的 spark 作业需要一个文件作为命令行参数,但是当我在工作流中将该文件作为 /file/location 传递时,它并没有选择该文件。

I got one workaround, if we put the file in a custom-directory in ozzie shared library with a few additional change in job.properties我有一个解决方法,如果我们将文件放在 ozzie 共享库中的自定义目录中,并在 job.properties 中进行一些额外的更改

  • oozie.use.system.libpath=true oozie.use.system.libpath=true
  • oozie.action.sharelib.for.spark=spark,custom-directory oozie.action.sharelib.for.spark=spark,custom-directory
  • oozie.libpath=true oozie.libpath=true

Then we need to update the shared lib using below command:然后我们需要使用以下命令更新共享库:

oozie admin -auth SIMPLE -sharelibupdate

After that we can directly pick up the file by just using the name of the file, which we placed in custom-directory, in the oozie workflow.之后我们可以直接使用oozie工作流中放置在custom-directory中的文件名直接提取文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM