mscsky
0.46D
V2EX  ›  Scala

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

  •  
  •   mscsky · Mar 2, 2017 · 11670 views
    This topic created in 3557 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
    funky
    Jun 22, 2017
    1
    case class 一般是你要转的 model
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   929 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 20:05 · PVG 04:05 · LAX 12:05 · JFK 15:05
    ♥ Do have faith in what you're doing.