码迷,mamicode.com
首页 > 系统相关 > 详细

spark-shell 执行脚本并传入参数

时间:2016-03-11 14:10:19      阅读:813      评论:0      收藏:0      [点我收藏+]

标签:

使用方法:

./spark-script.sh your_file.scala first_arg second_arg third_arg


脚本

scala_file=$1

shift 1

arguments=$@

#set +o posix  # to enable process substitution when not running on bash 

spark-shell  --master yarn --deploy-mode client          --queue default         --driver-memory 2G --executor-memory 4G         --num-executors 10         -i <(echo val args = "$arguments".split("\\s+") ; cat $scala_file)

linux shell 重定向:

Command < filename > filename2 Command命令以filename文件作为标准输入,以filename2文件作为标准输出

 

 

参考文献:

http://stackoverflow.com/questions/29928999/passing-command-line-arguments-to-spark-shell

spark-shell 执行脚本并传入参数

标签:

原文地址:http://www.cnblogs.com/tugeler/p/5265331.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!