我正在执行HDP的后续工作。
export SPARK-MAJOR-VERSION=2 spark-submit --class com.spark.sparkexamples.Audit --master yarn --deploy-mode cluster \ --files /bigdata/datalake/app/config/metadata.csv BRNSAUDIT_v4.jar dl_raw.ACC /bigdatahdfs/landing/AUDIT/BW/2017/02/27/ACC_hash_total_and_count_20170227.dat TH 20170227这是错误的失败:
表或视图找不到:
dl_raw.ACC;第1行pos 94;集合计数(1)为rec_cnt#58L,计数(‘BRCH_NUM)为hashcount#59,和(’ACC_NUM)为hashsum#60 +-‘滤波器(’trim(‘country_code)=trim(TH)&trim(TH)&trim,11),MM/dd/yyyy( yyyyMMdd) = 20170227)) + 'UnresolvedRelationdl_raw.’AS *
然而,表格存在于蜂巢中,它可以从火花壳中获得。
这是火花会话的代码。
val sparkSession = SparkSession.builder .appName("spark session example") .enableHiveSupport() .getOrCreate()
sparkSession.conf.set("spark.sql.crossJoin.enabled", "true")
val df_table_stats = sparkSession.sql("""select count(*) as rec_cnt,count(distinct BRCH_NUM) as hashcount, sum(ACC_NUM) as hashsum
from dl_raw.ACC
where trim(country_code) = trim('BW')
and from_unixtime(unix_timestamp(substr(bus_date,0,11),'MM/dd/yyyy'),'yyyyMMdd')='20170227'
""")发布于 2018-01-22 04:47:33
提交火花作业时,在--file参数中包含hive-site.xml。
发布于 2018-10-11 13:15:40
您还可以将hive-site.xml配置文件从hive复制到file。这应该能解决你的问题。
cp /etc/hive/conf/hive-site.xml /etc/spark2/conf
https://stackoverflow.com/questions/48351957
复制相似问题