#!/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

 

相关文章:

  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2021-10-16
  • 2021-06-21
  • 2022-12-23
猜你喜欢
  • 2021-07-12
  • 2022-12-23
  • 2021-12-04
  • 2021-07-01
  • 2021-09-01
  • 2021-10-16
相关资源
相似解决方案