【问题标题】:Pyspark Class org.openx.data.jsonserde.JsonSerDe not found even after including the jarsPyspark Class org.openx.data.jsonserde.JsonSerDe 即使在包含罐子后也找不到
【发布时间】:2020-03-09 09:09:30
【问题描述】:

我正在尝试执行一个简单的选择:

spark = SparkSession \
    .builder \
    .config("hive.mapred.supports.subdirectories","TRUE") \
    .config("mapred.input.dir.recursive","TRUE") \
    .appName("sql_test") \
    .enableHiveSupport() \
    .getOrCreate()

spark.sql("SELECT * FROM db.table LIMIT 10").show()

在使用 org.openx.data.jsonserde.JsonSerDe 的表上,但我得到了异常:

ERROR hive.log: error in initSerDe: java.lang.ClassNotFoundException Class org.openx.data.jsonserde.JsonSerDe not found
java.lang.ClassNotFoundException: Class org.openx.data.jsonserde.JsonSerDe not found
...

我已经尝试了我在 stackoverflow 和 cloudera 论坛上找到的每一个建议,但似乎没有任何改变。 jar 包含在集群中,此外我已经尝试过:

  • 使用 --jars /path/json-serde-1.3.8-jar-with-dependencies.jar 包含 jar

  • 使用 .config("spark.jars","hdfs://path/json-serde-1.3.8-jar-with-dependencies.jar")

  • 使用 spark.sparkContext.addPyFile("hdfs://path/json-serde-1.3.8-jar-with-dependencies.jar")

  • 使用 --class org.openx.data.jsonserde.JsonSerDe 指定类

  • 其他配置如设置--conf spark.executor/driver.classpath.first=true,--conf spark.executor/driver.extraClassPath=hdfs://path/json-serde-1.3.8 -jar-with-dependencies.jar

  • 使用客户端/集群模式部署,将 master 设置为 local/yarn

  • 在 Scala 中编译项目而不是使用 Python

然而 nothing 似乎工作,输出没有改变。 使用 Hive 访问表没有问题,但我似乎无法使用 Spark 做任何事情。

任何建议可能是什么问题?谢谢你

【问题讨论】:

    标签: scala apache-spark pyspark pyspark-sql


    【解决方案1】:

    您是否尝试过在 spark.sql 中添加这样的 jar?这是对使用 --jars /path/json-serde-1.3.8-jar-with-dependencies.jar 的 jar 的补充

    spark.sql(s"添加 jar /path/json-serde-1.3.8-jar-with-dependencies.jar")

    【讨论】:

      猜你喜欢
      • 2013-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-27
      • 1970-01-01
      • 2015-08-16
      • 2015-02-10
      • 1970-01-01
      相关资源
      最近更新 更多