V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
mscsky
0.46D
V2EX  ›  Scala

请问我下载了乌云的 digatalAllData,说明上写着用 case class 解析出数据,那有没有详细的方法?

  •  
  •   mscsky · Mar 2, 2017 · 7128 views
    This topic created in 3355 days ago, the information mentioned may be changed or developed.

    如题,下载了 2.9g 的数据不熟悉 scala 不知道怎么读取出来 readme 如下

    “如果使用 scala,可以使用如下 case class 解析出数据

    
    case class Answer(answer_id: Long,
    				  question_id: Long,
    				  question_title: String, 
    				  question_topics: Array[Long], 
    				  votup_count: Long)
    
    case class Article(id: Long, title: String, votup_count: Long)
    case class Question(question_followers: Long, 
    					question_id: Long, 
    					question_title: String, 
    					question_topics: Array[Long])
    
    case class userStringId(CREATED_ANSWERS: Array[Answer],
                              CREATED_ARTICLES: Array[Article],
                              CREATED_QUESTIONS: Array[Question],
                              FOLLOWED_QUESTIONS: Array[Question],
                              VOTEUPED_ANSWERS: Array[Answer],
                              VOTEUPED_ARTICLES: Array[Article],
                              followers_count: Long,
                              id: String)
    
    case class userDigitalId(CREATED_ANSWERS: Array[Answer],
                               CREATED_ARTICLES: Array[Article],
                               CREATED_QUESTIONS: Array[Question],
                               FOLLOWED_QUESTIONS: Array[Question],
                               VOTEUPED_ANSWERS: Array[Answer],
                               VOTEUPED_ARTICLES: Array[Article],
                               followers_count: Long,
                               id: Long)
    
    1 replies    2017-06-22 17:06:44 +08:00
    funky
        1
    funky  
       Jun 22, 2017
    case class 一般是你要转的 model
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2991 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 08:39 · PVG 16:39 · LAX 01:39 · JFK 04:39
    ♥ Do have faith in what you're doing.