Spark 使用 Hive元数据遇到的一些问题


Required field ‘client_protocol’ is unset!

beeline 出现 org.apache.thrift.TApplicationException: Required field ‘client_protocol’ is unset! Struct:TOpenSessionReq(client_protocol:null,configuration:set:hiveconf:hive.server2.thrift.resultset.default.fetch.size=1000,use:database=default})
原值 替换值
hive/bin 下的 beeline spark/bin 下的 beeline

spark 不使用hive的源数据表的问题

对 spark2-hive-site-override 做修改

原值 替换值
metastore.catalog.default=spark metastore.catalog.default=hive

Table is marked as a managed table but is not transactional.

AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Table default.partition_test failed strict managed table checks due to the following reason: Table is marked as a managed table but is not transactional.)

对hive-site.xml做修改

原值 替换值
hive.strict.managed.tables=true hive.strict.managed.tables=false

file is not owned by hive and load data is also not ran as hive

org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: Load Data failed for hdfs://***:8020/warehouse/tablespace/managed/hive/***/.hive-staging_hive_2019-07-02_18-17-08_028_419193115114639265-1/-ext-10000/part-00000-1f0e8f19-6a12-448f-ba18-a2319711c0aa-c000 as the file is not owned by hive and load data is also not ran as hive;

spark hive-site.xml 添加 hive.load.data.owner=spark (具体执行用户)

AnalysisException: java.lang.NullPointerException: null

org.apache.spark.sql.AnalysisException: java.lang.NullPointerException: null;at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:106)

spark sql 不支持 hive 的 OrcInputFormat 格式


文章作者: hnbian
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 hnbian !
评论
 上一篇
编译GreenPlum源码时遇见的问题及解决方式 编译GreenPlum源码时遇见的问题及解决方式
前段时间编译了 greenplum 源码, 过程中遇到了一些问题, 在这里进行一下记录, 希望能够帮助遇见相同问题的小伙伴更快的解决问题。 Could not fetch URL https://pypi.python.org/simple
2022-03-08
下一篇 
ARM 服务器编译部署 GreenPlum 6.9 ARM 服务器编译部署 GreenPlum 6.9
Greenplum是一款全球领先的开源大数据平台,为全球各行各业提供具备实时处理、弹性扩容、弹性计算、混合负载、云原生和集成数据分析能力的强大的大数据引擎,目前广泛的应用于包括金融、保险、证券、通信、航空、物流、零售、媒体、政府、医疗、制造
2022-02-17
  目录