我正在尝试连接多个Cassandra表并使用Scala显示它们。 我收到错误消息:
error: value map is not a member of model.UserMap
mapResult.map(x => x.map(xx => xx.map(xxx =>
这是我的代码:
import database.UserConnProvider
import database.PhantomUserRepository
import database.PhantomUserMapRepository
import com.softwaremill.macwire._
lazy val cassConn = wire[UserConnProvider]
val user = cassConn
import com.outworkers.phantom.connectors.CassandraConnection
import com.datastax.driver.core._
import com.typesafe.config.ConfigFactory
val connection = user.get()
implicit val session: Session = connection.session
implicit val keySpace = connection.provider.space //provider.space
val config: com.typesafe.config.Config = ConfigFactory.load()
val tableName: String = "map"
import controllers.UserController
import com.outworkers.phantom.connectors.CassandraConnection
import scala.concurrent.{ExecutionContext, Future}
lazy val phantomUserMapRepo = new PhantomUserMapRepository(cassConn.get() , ExecutionContext.Implicits.global)
val userMapRepo = phantomUserMapRepo
import scala.concurrent.ExecutionContext.Implicits.global
import play.api.libs.json._
val mapResult = userMapRepo.findMap("tc")
mapResult.map(x => x.map(xx => xx.map(xxx =>
for(iter <- xxx.ticker.toArray) {
println(iter)
}
)))
数据库定义:
users
user_info
,map
,tc_codes_map
。user_info
通过map
连接到company_code
。map
的{{1}}列连接到ticker
将感谢您的提示!
谢谢!