How to load files in sparksql through remote hive storage ( s3 orc) using spark/scala + code + configuration

ぃ、小莉子 提交于 2019-12-06 11:27:37

Try this:

val spark = SparkSession.builder
  .master("local[*]")
  .appName("hivetable")
  .config("hive.metastore.uris", "thrift://10.20.30.40:9083")
  .config("fs.s3n.awsAccessKeyId","PQHFFDEGGDDVDVV")
  .config("fs.s3n.awsSecretAccessKey","FFGSGHhjhhhdjhJHJHHJGJHGjHH")
  .config("format", "orc")
  .enableHiveSupport()
  .getOrCreate()

you need to prefix all the fs. options with spark.hadoop if you are setting them in the spark config. And as noted: use s3a over s3n if you can.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!