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

    https://github.com/apache/spark/pull/6228#discussion_r30621013
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala ---
    @@ -158,6 +158,9 @@ class Word2Vec extends Serializable with Logging {
           .sortWith((a, b) => a.cn > b.cn)
         
         vocabSize = vocab.length
    +    require(vocabSize > 0, "The vocabulary size should be large than 0. 
You may need to check " +
    --- End diff --
    
    Yeah, this is real minor point of taste. I use `IllegalStateException` when 
there's no real argument to speak of, which is marginally more specific and 
description. But isn't this error caused by a bad input RDD? 
`IllegalArgumentException` seems like just the thing.


---
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