【问题标题】:Hive UDF to process array of integers in ScalaHive UDF 在 Scala 中处理整数数组
【发布时间】: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 中的数组列?

【问题讨论】:

标签: scala hadoop apache-spark hive udf


【解决方案1】:

经过一些研究,我发现了该案例的特定类别:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-12
    • 1970-01-01
    • 1970-01-01
    • 2020-11-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多