1
我是scala中的新手,我需要编写用户定义的函数来处理Hive中的整数数组列(类型array<int>
)。Hive UDF处理Scala中的整数数组
我已经试过:
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中使用与阵列列工作蜂巢?
您将需要使用Hadoop的数据类型('writable') - http://hadooptutorial.info/hadoop-data-types/ –