Spark随机森林模型保存方法不起作用

时间:2015-12-16 18:54:52

标签: apache-spark random-forest apache-spark-mllib

我最近将Spark的版本从1.3升级到1.5。我使用model.save来保存随机森林模型。我的代码在1.3中正常工作,但在1.5中我得到了以下错误。

  

错误:org.apache.spark.executor.Executor - 阶段18.0中的任务1.0中的异常(TID 63)   java.lang.NoSuchMethodError:parquet.schema.Types $ GroupBuilder.addField(Lparquet / schema / Type;)Lparquet / schema / Types $ BaseGroupBuilder;       在org.apache.spark.sql.execution.datasources.parquet.CatalystSchemaConverter $$ anonfun $ convertField $ 1.apply(CatalystSchemaConverter.scala:517)       在org.apache.spark.sql.execution.datasources.parquet.CatalystSchemaConverter $$ anonfun $ convertField $ 1.apply(CatalystSchemaConverter.scala:516)       在scala.collection.IndexedSeqOptimized $ class.foldl(IndexedSeqOptimized.scala:51)       在scala.collection.IndexedSeqOptimized $ class.foldLeft(IndexedSeqOptimized.scala:60)       at scala.collection.mutable.ArrayOps $ ofRef.foldLeft(ArrayOps.scala:108)       在org.apache.spark.sql.execution.datasources.parquet.CatalystSchemaConverter.convertField(CatalystSchemaConverter.scala:516)       在org.apache.spark.sql.execution.datasources.parquet.CatalystSchemaConverter.convertField(CatalystSchemaConverter.scala:312)       在org.apache.spark.sql.execution.datasources.parquet.CatalystSchemaConverter $$ anonfun $ convert $ 1.apply(CatalystSchemaConverter.scala:305)       在org.apache.spark.sql.execution.datasources.parquet.CatalystSchemaConverter $$ anonfun $ convert $ 1.apply(CatalystSchemaConverter.scala:305)       在scala.collection.TraversableLike $$ anonfun $ map $ 1.apply(TraversableLike.scala:244)       在scala.collection.TraversableLike $$ anonfun $ map $ 1.apply(TraversableLike.scala:244)       在scala.collection.Iterator $ class.foreach(Iterator.scala:727)       在scala.collection.AbstractIterator.foreach(Iterator.scala:1157)       在scala.collection.IterableLike $ class.foreach(IterableLike.scala:72)       at org.apache.spark.sql.types.StructType.foreach(StructType.scala:92)       在scala.collection.TraversableLike $ class.map(TraversableLike.scala:244)       at org.apache.spark.sql.types.StructType.map(StructType.scala:92)       在org.apache.spark.sql.execution.datasources.parquet.CatalystSchemaConverter.convert(CatalystSchemaConverter.scala:305)       at org.apache.spark.sql.execution.datasources.parquet.ParquetTypesConverter $ .convertFromAttributes(ParquetTypesConverter.scala:58)       在org.apache.spark.sql.execution.datasources.parquet.RowWriteSupport.init(ParquetTableSupport.scala:55)       在parquet.hadoop.ParquetOutputFormat.getRecordWriter(ParquetOutputFormat.java:287)       在parquet.hadoop.ParquetOutputFormat.getRecordWriter(ParquetOutputFormat.java:261)       在org.apache.spark.sql.execution.datasources.parquet.ParquetOutputWriter。(ParquetRelation.scala:94)       在org.apache.spark.sql.execution.datasources.parquet.ParquetRelation $$ anon $ 3.newInstance(ParquetRelation.scala:272)       at org.apache.spark.sql.execution.datasources.DefaultWriterContainer.writeRows(WriterContainer.scala:233)       在org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelation $$ anonfun $ run $ 1 $$ anonfun $ apply $ mcV $ sp $ 3.apply(InsertIntoHadoopFsRelation.scala:150)       在org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelation $$ anonfun $ run $ 1 $$ anonfun $ apply $ mcV $ sp $ 3.apply(InsertIntoHadoopFsRelation.scala:150)       在org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)       在org.apache.spark.scheduler.Task.run(Task.scala:88)       在org.apache.spark.executor.Executor $ TaskRunner.run(Executor.scala:214)       在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)       at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)       在java.lang.Thread.run(Thread.java:745)   错误:org.apache.spark.executor.Executor - 阶段18.0中的任务0.0中的异常(TID 62)

[INFO] +- org.apache.spark:spark-streaming-kafka_2.11:jar:1.5.2:provided
[INFO] |  +- org.apache.kafka:kafka_2.11:jar:0.8.2.1:provided
[INFO] |  |  +- org.scala-lang.modules:scala-xml_2.11:jar:1.0.2:provided
[INFO] |  |  +- com.yammer.metrics:metrics-core:jar:2.2.0:provided
[INFO] |  |  +- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.2:provided
[INFO] |  |  +- com.101tec:zkclient:jar:0.3:provided
[INFO] |  |  \- org.apache.kafka:kafka-clients:jar:0.8.2.1:provided
[INFO] |  \- org.spark-project.spark:unused:jar:1.0.0:provided
[INFO] +- org.apache.spark:spark-streaming_2.11:jar:1.5.2:provided
[INFO] |  \- org.scala-lang:scala-library:jar:2.11.7:provided
[INFO] +- org.apache.spark:spark-core_2.11:jar:1.5.2:provided
[INFO] |  +- org.apache.avro:avro-mapred:jar:hadoop2:1.7.7:provided
[INFO] |  |  +- org.apache.avro:avro-ipc:jar:1.7.7:provided
[INFO] |  |  |  \- org.apache.avro:avro:jar:1.7.7:provided
[INFO] |  |  +- org.apache.avro:avro-ipc:jar:tests:1.7.7:provided
[INFO] |  |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:provided
[INFO] |  |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:provided
[INFO] |  +- com.twitter:chill_2.11:jar:0.5.0:provided
[INFO] |  |  \- com.esotericsoftware.kryo:kryo:jar:2.21:provided
[INFO] |  |     +- com.esotericsoftware.reflectasm:reflectasm:jar:shaded:1.07:provided
[INFO] |  |     +- com.esotericsoftware.minlog:minlog:jar:1.2:provided
[INFO] |  |     \- org.objenesis:objenesis:jar:1.2:provided
[INFO] |  +- com.twitter:chill-java:jar:0.5.0:provided
[INFO] |  +- org.apache.hadoop:hadoop-client:jar:2.2.0:provided
[INFO] |  |  +- org.apache.hadoop:hadoop-common:jar:2.2.0:provided
[INFO] |  |  |  +- commons-cli:commons-cli:jar:1.2:provided
[INFO] |  |  |  +- org.apache.commons:commons-math:jar:2.1:provided
[INFO] |  |  |  +- xmlenc:xmlenc:jar:0.52:provided
[INFO] |  |  |  +- commons-configuration:commons-configuration:jar:1.6:provided
[INFO] |  |  |  |  +- commons-collections:commons-collections:jar:3.2.1:provided
[INFO] |  |  |  |  +- commons-digester:commons-digester:jar:1.8:provided
[INFO] |  |  |  |  |  \- commons-beanutils:commons-beanutils:jar:1.7.0:provided
[INFO] |  |  |  |  \- commons-beanutils:commons-beanutils-core:jar:1.8.0:provided
[INFO] |  |  |  +- org.apache.hadoop:hadoop-auth:jar:2.2.0:provided
[INFO] |  |  |  \- org.apache.commons:commons-compress:jar:1.4.1:provided
[INFO] |  |  |     \- org.tukaani:xz:jar:1.0:provided
[INFO] |  |  +- org.apache.hadoop:hadoop-hdfs:jar:2.2.0:provided
[INFO] |  |  |  \- org.mortbay.jetty:jetty-util:jar:6.1.26:provided
[INFO] |  |  +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.2.0:provided
[INFO] |  |  |  +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.2.0:provided
[INFO] |  |  |  \- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.2.0:provided
[INFO] |  |  +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.2.0:provided
[INFO] |  |  +- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.2.0:provided
[INFO] |  |  \- org.apache.hadoop:hadoop-annotations:jar:2.2.0:provided
[INFO] |  +- org.apache.spark:spark-launcher_2.11:jar:1.5.2:provided
[INFO] |  +- org.apache.spark:spark-network-common_2.11:jar:1.5.2:provided
[INFO] |  +- org.apache.spark:spark-network-shuffle_2.11:jar:1.5.2:provided
[INFO] |  +- org.apache.spark:spark-unsafe_2.11:jar:1.5.2:provided
[INFO] |  +- net.java.dev.jets3t:jets3t:jar:0.7.1:provided
[INFO] |  |  \- commons-httpclient:commons-httpclient:jar:3.1:provided
[INFO] |  +- org.apache.curator:curator-recipes:jar:2.4.0:provided
[INFO] |  |  +- org.apache.curator:curator-framework:jar:2.4.0:provided
[INFO] |  |  +- org.apache.zookeeper:zookeeper:jar:3.4.5:provided
[INFO] |  |  |  \- jline:jline:jar:0.9.94:provided
[INFO] |  |  \- com.google.guava:guava:jar:14.0.1:provided
[INFO] |  +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:provided
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.3.2:provided
[INFO] |  +- org.apache.commons:commons-math3:jar:3.4.1:provided
[INFO] |  +- org.slf4j:jul-to-slf4j:jar:1.7.10:provided
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.10:provided
[INFO] |  +- com.ning:compress-lzf:jar:1.0.3:provided
[INFO] |  +- org.xerial.snappy:snappy-java:jar:1.1.1.7:provided
[INFO] |  +- net.jpountz.lz4:lz4:jar:1.3.0:provided
[INFO] |  +- org.roaringbitmap:RoaringBitmap:jar:0.4.5:provided
[INFO] |  +- commons-net:commons-net:jar:2.2:provided
[INFO] |  +- com.typesafe.akka:akka-remote_2.11:jar:2.3.11:provided
[INFO] |  |  +- com.typesafe.akka:akka-actor_2.11:jar:2.3.11:provided
[INFO] |  |  |  \- com.typesafe:config:jar:1.2.1:provided
[INFO] |  |  +- io.netty:netty:jar:3.8.0.Final:provided
[INFO] |  |  +- com.google.protobuf:protobuf-java:jar:2.5.0:provided
[INFO] |  |  \- org.uncommons.maths:uncommons-maths:jar:1.2.2a:provided
[INFO] |  +- com.typesafe.akka:akka-slf4j_2.11:jar:2.3.11:provided
[INFO] |  +- org.json4s:json4s-jackson_2.11:jar:3.2.10:provided
[INFO] |  |  \- org.json4s:json4s-core_2.11:jar:3.2.10:provided
[INFO] |  |     +- org.json4s:json4s-ast_2.11:jar:3.2.10:provided
[INFO] |  |     \- org.scala-lang:scalap:jar:2.11.0:provided
[INFO] |  |        \- org.scala-lang:scala-compiler:jar:2.11.0:provided
[INFO] |  +- com.sun.jersey:jersey-server:jar:1.9:provided
[INFO] |  |  \- asm:asm:jar:3.1:provided
[INFO] |  +- com.sun.jersey:jersey-core:jar:1.9:provided
[INFO] |  +- org.apache.mesos:mesos:jar:shaded-protobuf:0.21.1:provided
[INFO] |  +- io.netty:netty-all:jar:4.0.29.Final:provided
[INFO] |  +- com.clearspring.analytics:stream:jar:2.7.0:provided
[INFO] |  +- io.dropwizard.metrics:metrics-core:jar:3.1.2:provided
[INFO] |  +- io.dropwizard.metrics:metrics-jvm:jar:3.1.2:provided
[INFO] |  +- io.dropwizard.metrics:metrics-json:jar:3.1.2:provided
[INFO] |  +- io.dropwizard.metrics:metrics-graphite:jar:3.1.2:provided
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:provided
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:provided
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.4.4:provided
[INFO] |  +- com.fasterxml.jackson.module:jackson-module-scala_2.11:jar:2.4.4:provided
[INFO] |  |  \- com.thoughtworks.paranamer:paranamer:jar:2.6:provided
[INFO] |  +- org.apache.ivy:ivy:jar:2.4.0:provided
[INFO] |  +- oro:oro:jar:2.0.8:provided
[INFO] |  +- org.tachyonproject:tachyon-client:jar:0.7.1:provided
[INFO] |  |  +- commons-lang:commons-lang:jar:2.4:provided
[INFO] |  |  +- commons-io:commons-io:jar:2.4:provided
[INFO] |  |  +- org.apache.curator:curator-client:jar:2.1.0-incubating:provided
[INFO] |  |  +- org.tachyonproject:tachyon-underfs-hdfs:jar:0.7.1:provided
[INFO] |  |  \- org.tachyonproject:tachyon-underfs-local:jar:0.7.1:provided
[INFO] |  +- net.razorvine:pyrolite:jar:4.4:provided
[INFO] |  \- net.sf.py4j:py4j:jar:0.8.2.1:provided
[INFO] +- org.apache.spark:spark-mllib_2.11:jar:1.5.2:provided
[INFO] |  +- org.apache.spark:spark-graphx_2.11:jar:1.5.2:provided
[INFO] |  |  +- com.github.fommil.netlib:core:jar:1.1.2:provided
[INFO] |  |  \- net.sourceforge.f2j:arpack_combined_all:jar:0.1:provided
[INFO] |  +- org.scalanlp:breeze_2.11:jar:0.11.2:provided
[INFO] |  |  +- org.scalanlp:breeze-macros_2.11:jar:0.11.2:provided
[INFO] |  |  +- net.sf.opencsv:opencsv:jar:2.3:provided
[INFO] |  |  +- com.github.rwl:jtransforms:jar:2.4.0:provided
[INFO] |  |  \- org.spire-math:spire_2.11:jar:0.7.4:provided
[INFO] |  |     \- org.spire-math:spire-macros_2.11:jar:0.7.4:provided
[INFO] |  \- org.jpmml:pmml-model:jar:1.1.15:provided
[INFO] |     +- org.jpmml:pmml-agent:jar:1.1.15:provided
[INFO] |     +- org.jpmml:pmml-schema:jar:1.1.15:provided
[INFO] |     \- com.sun.xml.bind:jaxb-impl:jar:2.2.7:provided
[INFO] |        \- com.sun.xml.bind:jaxb-core:jar:2.2.7:provided
[INFO] |           \- javax.xml.bind:jaxb-api:jar:2.2.7:provided
[INFO] +- org.apache.spark:spark-sql_2.11:jar:1.5.2:provided
[INFO] |  +- org.apache.parquet:parquet-column:jar:1.7.0:provided
[INFO] |  |  +- org.apache.parquet:parquet-common:jar:1.7.0:provided
[INFO] |  |  \- org.apache.parquet:parquet-encoding:jar:1.7.0:provided
[INFO] |  |     \- org.apache.parquet:parquet-generator:jar:1.7.0:provided
[INFO] |  \- org.apache.parquet:parquet-hadoop:jar:1.7.0:provided
[INFO] |     +- org.apache.parquet:parquet-format:jar:2.3.0-incubating:provided
[INFO] |     \- org.apache.parquet:parquet-jackson:jar:1.7.0:provided
[INFO] +- org.apache.spark:spark-catalyst_2.11:jar:1.5.2:provided
[INFO] |  +- org.scala-lang:scala-reflect:jar:2.11.7:provided
[INFO] |  \- org.codehaus.janino:janino:jar:2.7.8:provided
[INFO] |     \- org.codehaus.janino:commons-compiler:jar:2.7.8:provided
[INFO] +- org.apache.spark:spark-yarn_2.11:jar:1.5.2:provided

0 个答案:

没有答案