配置单元UDF处理Scala中的整数数组
我是scala的新手,需要编写用户定义的函数来处理配置单元中带有整数数组的列(type配置单元UDF处理Scala中的整数数组,scala,hadoop,apache-spark,hive,udf,Scala,Hadoop,Apache Spark,Hive,Udf,我是scala的新手,需要编写用户定义的函数来处理配置单元中带有整数数组的列(typearray) 我试过: 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
array
)
我试过:
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)
类没有匹配方法。。。使用(数组、字符串)。可能的选项:_FUNC(结构,字符串)
我需要在Scala中使用什么类型来处理Hive中的数组列?经过一些研究,我找到了这种情况下的特定类:
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
经过一些研究,我发现了这种情况的具体类别:
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
您需要使用hadoop数据类型(
writeable
)-您需要使用hadoop数据类型(writeable
)-