首页 > 系统服务 > 详细

Spark-shell批量命令执行脚本

时间:2017-06-27 07:55:28      阅读:380      评论:0      收藏:0      [点我收藏+]
#!/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批量命令执行脚本

原文:http://www.cnblogs.com/chenzechao/p/7083098.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!