nth2017
nth2017

Reputation: 13

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>**)
{
}

Upvotes: 1

Views: 322

Answers (1)

David דודו Markovitz
David דודו Markovitz

Reputation: 44921

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

Upvotes: 1

Related Questions