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

    https://github.com/apache/spark/pull/22236#discussion_r212987480
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/fpm/FPGrowth.scala ---
    @@ -326,6 +327,20 @@ object FPGrowthModel extends MLReadable[FPGrowthModel] 
{
           DefaultParamsWriter.saveMetadata(instance, path, sc)
           val dataPath = new Path(path, "data").toString
           instance.freqItemsets.write.parquet(dataPath)
    +      val itemDataType = 
instance.freqItemsets.schema(instance.getItemsCol).dataType match {
    +        case ArrayType(et, _) => et
    +        case other => throw new RuntimeException(s"Expected 
${ArrayType.simpleString}, but got " +
    --- End diff --
    
    I slightly prefer subclasses like `IllegalArgumentException` or 
`IllegalStateException`, but it's just a matter of taste. You can interpolate 
the second argument and probably get it on one line if you break before the 
message starts.


---

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

Reply via email to