こんな感じ。
Exception in thread "main" scala.MatchError: [foo,28,995,0.0] (of class org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema)
String, Long, Long, Doubleをイメージしていたので、こんな感じでMatchさせようとしていた。
case Row(hostName: String, score1: Long, score2: Long, cost: Double) =>
中身を確認。
case x: GenericRowWithSchema => { println(x.getClass); println(x.schema) } #=> StructType(StructField(host_name,StringType,true), StructField(score1,LongType,true), StructField(score2,LongType,false), StructField(cost,DecimalType(1,1),false))
Doubleではなくjava.math.BigDecimalというだけだった。。。
case Row(hostName: String, score1: Long, score2: Long, cost: java.math.BigDecimal) =>