【问题标题】:How to run Hive with Spark Execution Engine (Apache Hive version 2.1.1 and Apache Spark Version 2.2.0)如何使用 Spark 执行引擎运行 Hive(Apache Hive 版本 2.1.1 和 Apache Spark 版本 2.2.0)
【发布时间】:2018-01-05 07:18:39
【问题描述】:

我们已将 Hive 执行引擎从 MapReduce 切换到 Spark,并尝试使用 beelinejdbc 在 Hive shell 中运行查询。

我们能够运行简单的查询(例如:select * from table),因为它不需要处理数据,但是当我们尝试运行包含聚合函数的查询(例如:select count(*) from table)时,我们将面临以下错误:

Query ID = hadoop_20180105123047_5bcd0d7a-78bd-4b66-b5fb-fc430726c2a9
Total jobs = 1
Launching Job 1 out of 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
Failed to execute spark task, with exception 'org.apache.hadoop.hive.ql.metadata.HiveException(Failed to create spark client.)'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.spark.SparkTask

可能是什么问题?

【问题讨论】:

    标签: hive apache-spark-sql


    【解决方案1】:

    第一个查询有效的原因是它不需要运行任何 MR 或 Spark 作业。 HS2 或 Hive 客户端只是直接读取数据。第二个查询需要运行 MR 或 Spark 作业。这是在对集群进行测试或故障排除时要记住的关键。

    您能否在 Hive 之外运行 Spark 作业?

    【讨论】:

    • 是的,我们能够在 Hive 之外运行 spark 作业。即使我们已经将 Hive 版本升级到 Hive-2.3.2,但在 Hive shell 中运行查询时仍然无法连接 spark 客户端。
    猜你喜欢
    • 2017-07-05
    • 1970-01-01
    • 1970-01-01
    • 2019-11-12
    • 2023-03-25
    • 2019-12-21
    • 1970-01-01
    • 2018-07-14
    • 1970-01-01
    相关资源
    最近更新 更多