如何解决java.lang.NoSuchMethodError org.apache.spark.ml.util.SchemaUtils $ .checkColumnType [英] How to resolve java.lang.NoSuchMethodError org.apache.spark.ml.util.SchemaUtils$.checkColumnType

查看:506
本文介绍了如何解决java.lang.NoSuchMethodError org.apache.spark.ml.util.SchemaUtils $ .checkColumnType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行此处提供的CountVectorizerDemo程序:

I am trying to run the CountVectorizerDemo program provided here:

https://github.com/apache/spark/blob/master/examples/src/main/ java / org / apache / spark / examples / ml / JavaCountVectorizerExample.java

我遇到以下错误,不知道是什么问题

I'm getting the following error and don't know what the problem is.

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.spark.ml.util.SchemaUtils$.checkColumnType$default$4()Ljava/lang/String;
    at org.apache.spark.ml.feature.CountVectorizerParams$class.validateAndTransformSchema(CountVectorizer.scala:71)
    at org.apache.spark.ml.feature.CountVectorizer.validateAndTransformSchema(CountVectorizer.scala:107)
    at org.apache.spark.ml.feature.CountVectorizer.transformSchema(CountVectorizer.scala:168)
    at org.apache.spark.ml.PipelineStage.transformSchema(Pipeline.scala:59)
    at org.apache.spark.ml.feature.CountVectorizer.fit(CountVectorizer.scala:130)
    at com.bah.ossem.spark.topic.CountVectorizerDemo.main(CountVectorizerDemo.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:664)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:169)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:192)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:111)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)


推荐答案

问题是我的集群正在使用Spark核心1.4,但我的应用程序使用的是Spark核心1.5.1和MLlib 1.5.1。我将AWS集群更新为Spark 1.5.1,从而解决了该问题。

The problem was that my cluster was using Spark core 1.4 but my application was using Spark core 1.5.1 and MLlib 1.5.1. I updated my AWS cluster to Spark 1.5.1 and that fixed the problem.

这篇关于如何解决java.lang.NoSuchMethodError org.apache.spark.ml.util.SchemaUtils $ .checkColumnType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆