Hive UDF 在 Scala 中处理整数数组

Hive UDF to process array of integers in Scala

我是 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 中的数组列?

经过一些研究,我发现 class 特定于这些案例:

import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;