使用cassandra数据库在scala中进行Map的问题

wdebmtf2  于 2021-06-14  发布在  Cassandra
关注(0)|答案(0)|浏览(207)

我正在尝试连接几个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 table: user_info , map , tc_codes_map . user_info 连接到 map 通过 company_code . mapticker 连接到的列 tc_codes_map 如有任何提示,我将不胜感激!
谢谢您!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题