spark-submit --class "AuctionDataFrame" --master spark://<hostname>:7077 auction-project_2.11-1.0.jar
...
scala> val auctionsDF = auctionsRDD.toDF()
auctionsDF: org.apache.spark.sql.DataFrame = [aucid: string, bid: float, bidtime: float, bidder: string, bidrate: int, openbid: float, price: float, itemtype: string, dtl: int]
scala> auctionsDF.printSchema()
root
|-- aucid: string (nullable = true)
|-- bid: float (nullable = false)
|-- bidtime: float (nullable = false)
|-- bidder: string (nullable = true)
|-- bidrate: integer (nullable = false)
|-- openbid: float (nullable = false)
|-- price: float (nullable = false)
|-- itemtype: string (nullable = true)
|-- dtl: integer (nullable = false)
Exception in thread "main" java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror(Ljava/lang/ClassLoader;)Lscala/reflect/api/JavaMirrors$JavaMirror;
at AuctionDataFrame$.main(AuctionDataFrame.scala:52)
at AuctionDataFrame.main(AuctionDataFrame.scala)
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:498)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
case class Auctions(
aucid: String,
bid: Float,
bidtime: Float,
bidder: String,
bidrate: Int,
openbid: Float,
price: Float,
itemtype: String,
dtl: Int)
object AuctionDataFrame {
val AUCID = 0
val BID = 1
val BIDTIME = 2
val BIDDER = 3
val BIDRATE = 4
val OPENBID = 5
val PRICE = 6
val ITEMTYPE = 7
val DTL = 8
def main(args: Array[String]) {
val conf = new SparkConf().setAppName("AuctionDataFrame")
val sc = new SparkContext(conf)
val sqlContext = new org.apache.spark.sql.SQLContext(sc)
import sqlContext.implicits._
val inputRDD = sc.textFile("/user/wynadmin/auctiondata.csv").map(_.split(","))
val auctionsRDD = inputRDD.map(a =>
Auctions(
a(AUCID),
a(BID).toFloat,
a(BIDTIME).toFloat,
a(BIDDER),
a(BIDRATE).toInt,
a(OPENBID).toFloat,
a(PRICE).toFloat,
a(ITEMTYPE),
a(DTL).toInt))
val auctionsDF = auctionsRDD.toDF() // <--- line 52 causing the error.
}
name := "Auction Project"
version := "1.0"
scalaVersion := "2.11.8"
//scalaVersion := "2.10.6"
/*
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.6.2",
"org.apache.spark" %% "spark-sql" % "1.6.2",
"org.apache.spark" %% "spark-mllib" % "1.6.2"
)
*/
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.6.2" % "provided",
"org.apache.spark" %% "spark-sql" % "1.6.2" % "provided",
"org.apache.spark" %% "spark-mllib" % "1.6.2" % "provided"
)
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 1.6.2
/_/
Using Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_92)
D:\>sbt sbtVersion
[info] Set current project to root (in build file:/D:/)
[info] 0.13.12
因此,将build.sbt中的Scala版本更改为2.10,从而创建了2.10jar,但错误仍然存在。使用%provided或not不会改变错误。
scalaVersion := "2.10.6"
Spark1.6.2是用Scala2.11从源文件编译的。但是,spark-1.6.2-bin-nowle-hadoop.tgz被下载并放在lib/目录中。
我相信因为Spark-1.6.2-bin-nowle-hadoop.tgz是用Scala2.10编译的,所以会引起兼容性问题。
从lib目录中删除spark-1.6.2-bin-nowle-hadoop.tgz,并使用下面的库依赖项运行“sbt包”。
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.6.2" % "provided",
"org.apache.spark" %% "spark-sql" % "1.6.2" % "provided",
"org.apache.spark" %% "spark-mllib" % "1.6.2" % "provided"
)
本文向大家介绍Android bindservice失败解决方法,包括了Android bindservice失败解决方法的使用技巧和注意事项,需要的朋友参考一下 Android bindservice失败解决方法 现象: 相同的代码以前使用一直很正常,但最近在项目中使用却一直绑定失败,bindservice返回false。 原因: 使用了TabActivity, TabActivity里的子Ac
我是android编程的新手,我正在尝试通过改造连接到服务器并获取一些数据。我做了一个小例子来检查它是否会返回一些数据。首先,我不知道我是否编写了代码来做我想做的事情,其次,我得到了错误: "错误:(64,52)错误:不是抽象的,并且不重写回调中的抽象方法失败(RetrofitError)"和2个错误"错误:(67,13)错误:方法不重写或实现超类型中的方法" 这是我的代码。 }和我的改装界面 }
本文向大家介绍svn 清理失败 (cleanup 失败) 的快速解决方法,包括了svn 清理失败 (cleanup 失败) 的快速解决方法的使用技巧和注意事项,需要的朋友参考一下 1、cmd指令,进入.svn目录,找到wc.db文件 sqlite 3 打开 2、 对 svn源代码目录 右键, clean up, 稍等1至5分钟左右,然后会提示 清理成功 以上就是小编为大家带来的svn 清理失败 (
问题内容: 我创建了一个C ++类,应该通过以下方式调用:http : //docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html#wp9502。 我没有使其正常工作,所以我遵循了:http : //www.coderanch.com/t/525082/CPP/create-JVM-native-code- c
有人知道这个错误是怎么回事吗??