i'm using apache hive with and UDF function create in eclipse. So when i call the function in my sql query, i see this error:
FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments 'summary': No matching method for class HiveUDF.TokenizeString with (string). Possible choices:
Where is the problem?
UDF CLASS
package HiveUDF;
public class TokenizeString extends UDF {
public List<String> tokenize (Text text) {
List<String> prova = new ArrayList<String>();
if(text == null)
return null;
String[] words = text.toString().split("\\n");
for (String w : words)
prova.add(w);
return prova;
}
}
SQL TABLE AND QUERY
id bigint
productid string
userid string
profilename string
helpfulnessnumerator int
helpfulnessdenominator int
score float
time int
summary string
text string
CREATE TEMPORARY FUNCTION tokenize_summary as 'HiveUDF.TokenizeString';
select tokenize_summary(summary) from amazonproduct;
evaluate- franklinsijo