当前位置: 移动技术网 > 网络运营>服务器>Linux > Spark-shell批量命令执行脚本的方法

Spark-shell批量命令执行脚本的方法

2018年08月08日  | 移动技术网网络运营  | 我要评论

批量执行spark-shell命令,并指定提交参数

#!/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批量命令执行脚本的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网