【问题标题】:Spark 2.3.0 SQL unable insert data into hive hbase tableSpark 2.3.0 SQL 无法将数据插入 hive hbase 表
【发布时间】:2018-06-04 11:51:09
【问题描述】:

使用与 hive 2.2.0 集成的 Spark 2.3 thriftserver。从火花直线运行。尝试将数据插入 hive hbase 表(以 hbase 作为存储的 hive 表)。插入 hive 本机表是可以的。插入 hive hbase 表时,会抛出以下异常:

ClassCastException:org.apache.hadoop.hive.hbase.HiveHBaseTableOutputFormat 无法转换为 org.apache.hadoop.hive.ql.io.HiveOutputFormat

在 org.apache.spark.scheduler.Task.run(Task.scala:109) 在 org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) 引起:java.lang.ClassCastException:org.apache.hadoop.hive.hbase.HiveHBaseTableOutputFormat 不能转换为 org.apache.hadoop.hive.ql.io.HiveOutputFormat 在 org.apache.spark.sql.hive.execution.HiveFileFormat$$anon$1.outputFormat$lzycompute(HiveFileFormat.scala:93) k 在写入行时失败。 在 org.apache.spark.sql.execution.datasources.FileFormatWriter$.org$apache$spark$sql$execution$datasources$FileFormatWriter$$executeTask(FileFormatWriter.scala:285) 在 org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$write$1.apply(FileFormatWriter.scala:197) 在 org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$write$1.apply(FileFormatWriter.scala:196) 在 org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87) 在 org.apache.spark.scheduler.Task.run(Task.scala:109) 在 org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) 引起:java.lang.ClassCastException:org.apache.hadoop.hive.hbase.HiveHBaseTableOutputFormat 不能转换为 org.apache.hadoop.hive.ql.io.HiveOutputFormat 在 org.apache.spark.sql.hive.execution.HiveFileFormat$$anon$1.outputFormat$lzycompute(HiveFileFormat.scala:93)

【问题讨论】:

    标签: apache-spark hive apache-spark-sql hbase


    【解决方案1】:

    似乎是一个已知的蜂巢问题。有几个拉取请求解决了它,但我还没有找到实际的修复。

    https://issues.apache.org/jira/browse/SPARK-6628

    【讨论】:

    • 我检查了这个,似乎修复代码没有提交到 spark 中。 spark 2.3、2.2的源码还是用坏的。也有人说更改 HiveHBaseTableOutputFormat 以扩展 HiveOutputFormat,也没有提交到 hive 2.2 或 hive 2.3
    猜你喜欢
    • 1970-01-01
    • 2019-02-16
    • 1970-01-01
    • 1970-01-01
    • 2016-12-04
    • 1970-01-01
    • 2019-07-20
    • 2019-03-09
    • 2013-06-13
    相关资源
    最近更新 更多