【发布时间】:2016-06-21 18:19:22
【问题描述】:
我是 scala 的新手,我需要编写用户定义的函数来处理 Hive 中具有整数数组的列(类型 array<int>)。
我试过了:
import org.apache.hadoop.hive.ql.exec.UDF
class testUDF extends UDF {
def evaluate(arr: Array[Int], txt: String): Boolean = {
return false
}
}
但是当我尝试在 SQL 中调用它时出现错误:
No matching method for class ... with (array<int>, string). Possible choices: _FUNC_(struct<>, string)
我需要在 Scala 中使用什么类型来处理 Hive 中的数组列?
【问题讨论】:
-
您将需要使用 hadoop 数据类型 (
writable) - hadooptutorial.info/hadoop-data-types
标签: scala hadoop apache-spark hive udf