spark-shell 执行脚本,批量执行命令
#!/bin/bash
source /etc/profile
exec spark-shell --name spark-sql-test --executor-cores 8 --executor-memory 8g --num-executors 1 --conf spark.cleaner.ttl=240000 <<!EOF
var startTime = System.currentTimeMillis()
sql("select count(1) from ods_xxx.other_article_hive_textfile where created_date=2019 ").show()
var endTime = System.currentTimeMillis()
print("耗时:"+ (endTime - startTime))
!EOF