gpt4 book ai didi

scala - 安装 Spline 时出错(Spark 的数据沿袭工具)

转载 作者:行者123 更新时间:2023-12-04 15:24:56 47 4
gpt4 key购买 nike

我正在尝试在 Windows 中安装 Apache Spline。我的 Spark 版本是 2.4.0Scala 版本为 2.12.0我按照这里提到的步骤 https://absaoss.github.io/spline/我运行了 docker-compose 命令,UI 启动了

wget https://raw.githubusercontent.com/AbsaOSS/spline/release/0.5/docker-compose.yml
docker-compose up

之后我尝试运行以下命令来启动 pyspark shell

    pyspark \
--packages za.co.absa.spline.agent.spark:spark-2.4-spline-agent-bundle_2.12:0.5.3 \
--conf "spark.sql.queryExecutionListeners=za.co.absa.spline.harvester.listener.SplineQueryExecutionListener" \
--conf "spark.spline.producer.url=http://localhost:9090/producer"

这给我以下错误

    C:\Users\AyanBiswas\Documents\softwares\spark-2.4.0-bin-hadoop2.7\python\pyspark\shell.py:45: UserWarning: Failed to initialize Spark session.
warnings.warn("Failed to initialize Spark session.")
Traceback (most recent call last):
File "C:\Users\AyanBiswas\Documents\softwares\spark-2.4.0-bin-hadoop2.7\python\pyspark\shell.py", line 41, in <module>
spark = SparkSession._create_shell_session()
File "C:\Users\AyanBiswas\Documents\softwares\spark-2.4.0-bin-hadoop2.7\python\pyspark\sql\session.py", line 583, in _create_shell_session
return SparkSession.builder.getOrCreate()
File "C:\Users\AyanBiswas\Documents\softwares\spark-2.4.0-bin-hadoop2.7\python\pyspark\sql\session.py", line 183, in getOrCreate
session._jsparkSession.sessionState().conf().setConfString(key, value)
File "C:\Users\AyanBiswas\Documents\softwares\spark-2.4.0-bin-hadoop2.7\python\lib\py4j-0.10.7-src.zip\py4j\java_gateway.py", line 1257, in __call__
answer, self.gateway_client, self.target_id, self.name)
File "C:\Users\AyanBiswas\Documents\softwares\spark-2.4.0-bin-hadoop2.7\python\pyspark\sql\utils.py", line 63, in deco
return f(*a, **kw)
File "C:\Users\AyanBiswas\Documents\softwares\spark-2.4.0-bin-hadoop2.7\python\lib\py4j-0.10.7-src.zip\py4j\protocol.py", line 328, in get_return_value
format(target_id, ".", name), value)
py4j.protocol.Py4JJavaError: An error occurred while calling o31.sessionState.
: java.lang.NoSuchMethodError: org.apache.spark.internal.Logging.$init$(Lorg/apache/spark/internal/Logging;)V

我试图检查可能导致此错误的原因,大多数帖子都指向 scala version mismatch ,但我使用的是 scala 2.12.0 并且提到的 spline 包也适用于 scala 2.12。那么,我缺少什么?

最佳答案

我通过使用 spark 2.4.2Scala 2.12.10 解决了这个错误。原因是

  • 所有 spark 2.x 版本都是使用 scala 2.11 构建的
  • 只有 spark 2.4.2 是使用 scala 2.12 构建的

这在 spark 下载页面上提到 here

Note that, Spark 2.x is pre-built with Scala 2.11 except version 2.4.2, which is pre-built with Scala 2.12. Spark 3.0+ is pre-built with Scala 2.12.

关于scala - 安装 Spline 时出错(Spark 的数据沿袭工具),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62471145/

47 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com