Github user feynmanliang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8507#discussion_r38373389
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala ---
    @@ -811,19 +814,32 @@ object DistributedLDAModel extends 
Loader[DistributedLDAModel] {
           sc.parallelize(Seq(metadata), 
1).saveAsTextFile(Loader.metadataPath(path))
     
           val newPath = new Path(Loader.dataPath(path), 
"globalTopicTotals").toUri.toString
    -      
sc.parallelize(Seq(Data(Vectors.fromBreeze(globalTopicTotals)))).toDF()
    -        .write.parquet(newPath)
    +      val dataRDD = 
sc.parallelize(Seq(Row(Vectors.fromBreeze(globalTopicTotals))))
    +      sqlContext.createDataFrame(dataRDD, 
dataSchema).write.parquet(newPath)
     
           val verticesPath = new Path(Loader.dataPath(path), 
"topicCounts").toUri.toString
    -      graph.vertices.map { case (ind, vertex) =>
    -        VertexData(ind, Vectors.fromBreeze(vertex))
    -      }.toDF().write.parquet(verticesPath)
    +      val vertexDataRDD = graph.vertices.map { case (ind, vertex) =>
    +        Row(ind, Vectors.fromBreeze(vertex))
    +      }
    +      sqlContext.createDataFrame(vertexDataRDD, 
vertexDataSchema).write.parquet(verticesPath)
     
           val edgesPath = new Path(Loader.dataPath(path), 
"tokenCounts").toUri.toString
    -      graph.edges.map { case Edge(srcId, dstId, prop) =>
    -        EdgeData(srcId, dstId, prop)
    -      }.toDF().write.parquet(edgesPath)
    +      val edgeDataRDD = graph.edges.map { case Edge(srcId, dstId, prop) =>
    +        Row(srcId, dstId, prop)
    +      }
    +      sqlContext.createDataFrame(edgeDataRDD, 
edgeDataSchema).write.parquet(edgesPath)
         }
    --- End diff --
    
    newline


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to