开发者社区> 问答> 正文

org.apache.avro.SchemaParseException:未定义的名称

我的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,来自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正在尝试解析相同的模式。为什么spark作业在我的k8s 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,来自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火花星团上失败了?我真的很困惑,现在不知道如何调试。

展开
收起
k8s小能手 2019-01-09 14:35:59 2911 0
1 条回答
写回答
取消 提交回答
  • 整合最优质的专家资源和技术资料,问答解疑

    这可能是Avro的不同依赖关系。1.7.4VS 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?

    2019-07-17 23:25:00
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Sketching Data With T-Digest in Apache Spark 立即下载
Apache Wicket User Guide - Ref 立即下载
State of Security:Apache Spark&Apache Zeppelin 立即下载