我正在使用Scala&玩2.5。我坚持这个错误:
Game.scala:99: overloaded method value apply with alternatives:
[error] (block: => play.api.mvc.Result)play.api.mvc.Action[play.api.mvc.AnyContent] <and>
[error] (block: play.api.mvc.Request[play.api.mvc.AnyContent] => play.api.mvc.Result)play.api.mvc.Action[play.api.mvc.AnyContent] <and>
[error] [A](bodyParser: play.api.mvc.BodyParser[A])(block: play.api.mvc.Request[A] => play.api.mvc.Result)play.api.mvc.Action[A]
[error] cannot be applied to (Object)
[error] def start(id: String, apiKey: Option[String]) = Action {
这是功能:
def start(id: String, apiKey: Option[String]) = Action {
apiKey match {
case Some(API_KEY) => {
Server.actor ! Server.Start(id)
Ok("Started")
}
case _ => Future.successful(Unauthorized)
}
}
答案 0 :(得分:2)
问题是,match
语句的结果被推断为Object
,因为从一个案例陈述中您返回Result
,而另一个案例陈述则是Future[Result]
返回Object
,因此唯一常见的超类型是case _ => Future.successful(Unauthorized)
。要解决此问题,请将case _ => Unauthorized
更改为from pyspark.sql import HiveContext
HiveContext(sc).sql('from `dbname.tableName` select `*`')
。