华域联盟 linux shell Spark-shell批量命令执行脚本的方法

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

批量执行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批量命令执行脚本的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持华域联盟。

您可能感兴趣的文章:

本文由 华域联盟 原创撰写:华域联盟 » Spark-shell批量命令执行脚本的方法

转载请保留出处和原文链接:https://www.cnhackhy.com/19010.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部