Support Questions

Find answers, ask questions, and share your expertise

UDF with Variable length of arguments are not working in Impala, Any alternative solution?

avatar
Explorer

Below UDF works fine with Hive, but with Impala we are not able create function,

it give following error:

SQL Error [500051] [HY000]: [Cloudera][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:CatalogException: No compatible function signatures found

 

public class SumCols extends UDF {

	public double evaluate(Text... string) {
		double d = 0.0;
		for (Text s : string) {
			String str = s.toString();
			if (str != null)
				d += Double.parseDouble(str.toString());
		}
		return d;
	}

}

 

I believe it is because of Variable length of arguments Text... 

I am looking for its alternate solution in Impala.

 

 

2 REPLIES 2

avatar
Master Collaborator

Hi @HareshAmin ,

 

As per the below documentation it looks like Hive UDF's are not supported in Impala.

Please refer the documentation:

https://docs.cloudera.com/documentation/enterprise/5-8-x/topics/impala_udf.html

 

Regards,

Chethan YM

avatar
Community Manager

@HareshAmin Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.  



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: