0514-86177077
9:00-17:00(工作日)
批量執(zhí)行spark-shell命令,并指定提交參數(shù)
#!/bin/bash source /etc/profile exec $SPARK_HOME/bin/spark-shell --queue tv --name spark-sql-test --executor-cores 8 --executor-memory 8g --num-executors 8 --conf spark.cleaner.ttl=240000 !EOF import org.apache.spark.sql.SaveMode sql("set hive.exec.dynamic.partition=true") sql("set hive.exec.dynamic.partition.mode=nonstrict") sql("use hr") sql("SELECT * FROM t_abc ").rdd.saveAsTextFile("/tmp/out") sql("SELECT * FROM t_abc").rdd.map(_.toString).intersection(sc.textFile("/user/hdfs/t2_abc").map(_.toString).distinct).count !EOF
以上這篇Spark-shell批量命令執(zhí)行腳本的方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
標簽:海北 連云港 昌都 贛州 廣東 撫州 烏蘭察布 臨沂
上一篇:使用shell腳本執(zhí)行hive、sqoop命令的方法
下一篇:linux下利用shell在指定的行添加內(nèi)容的方法
Copyright ? 1999-2012 誠信 合法 規(guī)范的巨人網(wǎng)絡通訊始建于2005年
蘇ICP備15040257號-8