gpt4 book ai didi

scala - org.apache.avro.SchemaParseException : Undefined name

转载 作者:行者123 更新时间:2023-12-02 12:38:17 29 4
gpt4 key购买 nike

我的 spark 工作是从 kafka 读取信息并解码信息。我的 spark 作业在 MAC 上的本地 spark 集群 (https://archive.apache.org/dist/spark/spark-2.2.1/spark-2.2.1-bin-hadoop2.7.tgz) 上运行良好。但是在 k8s 和 openstack 上针对 spark (2.2.1-hadoop-2.7, from https://hub.docker.com/r/gettyimages/spark/tags ) 集群运行作业时,出现以下错误:

Caused by: org.apache.avro.SchemaParseException: Undefined name: "my_items"
at org.apache.avro.Schema.parse(Schema.java:1052)
at org.apache.avro.Schema.parse(Schema.java:1164)
at org.apache.avro.Schema.parse(Schema.java:1094)
at org.apache.avro.Schema$Parser.parse(Schema.java:927)
at org.apache.avro.Schema$Parser.parse(Schema.java:917)

我很确定在两种情况下,spark job 正在尝试解析相同的模式。为什么我的 k8s spark 集群上的 spark 作业失败了?我真的很困惑,现在不知道如何调试。欢迎任何提示。谢谢

最佳答案

Avro 的依赖关系可能不同. 1.7.4对比 1.7.7 .

容器图像:

$ find / | grep avro
/usr/spark-2.2.1/examples/src/main/python/avro_inputformat.py
/usr/spark-2.2.1/examples/src/main/resources/users.avro
/usr/spark-2.2.1/jars/avro-mapred-1.7.7-hadoop2.jar
/usr/hadoop-2.7.3/share/hadoop/kms/tomcat/webapps/kms/WEB-INF/lib/avro-1.7.4.jar
/usr/hadoop-2.7.3/share/hadoop/httpfs/tomcat/webapps/webhdfs/WEB-INF/lib/avro-1.7.4.jar
/usr/hadoop-2.7.3/share/hadoop/common/lib/avro-1.7.4.jar
/usr/hadoop-2.7.3/share/hadoop/tools/lib/avro-1.7.4.jar
/usr/hadoop-2.7.3/share/hadoop/mapreduce/lib/avro-1.7.4.jar
spark-2.2.1-bin-hadoop2.7.tgz文件:
$ find . | grep avro
./spark-2.2.1-bin-hadoop2.7/examples/src/main/python/avro_inputformat.py
./spark-2.2.1-bin-hadoop2.7/examples/src/main/resources/users.avro
./spark-2.2.1-bin-hadoop2.7/jars/avro-mapred-1.7.7-hadoop2.jar
./spark-2.2.1-bin-hadoop2.7/jars/avro-1.7.7.jar
./spark-2.2.1-bin-hadoop2.7/jars/avro-ipc-1.7.7.jar
# Hadoop Avro?

关于scala - org.apache.avro.SchemaParseException : Undefined name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54028707/

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