You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/12/23 12:07:55 UTC
[GitHub] [spark] bmarcott commented on a change in pull request #30889: [SPARK-33398] Fix loading tree models prior to Spark 3.0
bmarcott commented on a change in pull request #30889:
URL: https://github.com/apache/spark/pull/30889#discussion_r547927241
##########
File path: mllib/src/main/scala/org/apache/spark/ml/tree/treeModels.scala
##########
@@ -401,8 +403,13 @@ private[ml] object DecisionTreeModelReadWrite {
}
val dataPath = new Path(path, "data").toString
- val data = sparkSession.read.parquet(dataPath).as[NodeData]
- buildTreeFromNodes(data.collect(), impurityType)
+ var df = sparkSession.read.parquet(dataPath)
Review comment:
I guess spark schema doesn't allow setting default values (and converted from case class) to enable something like below?
spark.read.schema(nodeDataSchema).parquet(dataPath).as[NodeData]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org