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

    https://github.com/apache/spark/pull/5810#discussion_r29630338
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/tree/impl/DecisionTreeMetadata.scala
 ---
    @@ -107,8 +107,11 @@ private[tree] object DecisionTreeMetadata extends 
Logging {
           numTrees: Int,
           featureSubsetStrategy: String): DecisionTreeMetadata = {
     
    -    val numFeatures = input.take(1)(0).features.size
    +    require(!input.isEmpty, s"DecisionTree requires size of input RDD > 0, 
" +
    --- End diff --
    
    Good point. I also think this line should be placed before "val numExamples 
= input.count()" thus there will be a fast fail.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to