hiveudf处理scala中的整数数组

o3imoua4  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(342)

我是scala的新手,需要编写用户定义的函数来处理hive(type)中带有整数数组的列 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中使用什么类型来处理配置单元中的数组列?

hvvq6cgz

hvvq6cgz1#

经过一番研究,我发现这种情况有其特殊性:

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

相关问题