【发布时间】:2018-01-16 06:58:01
【问题描述】:
我正在尝试使用以下代码在 Spark 中创建 UDF
val makeSIfTesla = udf {(make: BigInt) => if(make == 0) 1 else make}
但我收到以下错误:
java.lang.UnsupportedOperationException: Schema for type Any is not supported
为什么?
【问题讨论】:
-
1 是整数,make 是 BigInt。让它们都一样。
标签: scala apache-spark user-defined-functions