Search code examples
hadoophiveudf

how to use result of collect_set in hive udf - evaluate method?


Hive query -

select ...MYUDF(collect_set(col1))..from tableN

Here col1 is of the type string. I want to perform certain logic on this passed collect_set of data. For user defined function I am extending class UDF and using the evaluate method. What should be the signature of evaluate method as array is getting passed from hive. I want to return string array from UDF.

public **<returnType>** evaluate(**<collect as what>**)
{
}

Solution

  • ArrayList<Text> (import java.util.ArrayList)