When I run a SELECT operation in Amazon Athena, I get a "function not registered" syntax error.
Resolution
If you try to use a function that Athena doesn't support, then you receive an error that's similar to one of the following messages:
- "SYNTAX_ERROR: line 1:8: Function function_name not registered"
- "FUNCTION_NOT_FOUND: line 1:8: Function 'function_name' not registered"
For a list of functions that Athena supports, see Functions in Amazon Athena. Or, run a SHOW FUNCTIONS statement. See the following partial example of the output:
Function Return Type Argument Types Function Type Deterministic Description
1 abs bigint bigint scalar true absolute value
2 abs decimal(p,s) decimal(p,s) scalar true absolute value
3 abs double double
If Athena doesn’t support the function that you want to use, then write a user defined function (UDF) in Athena. UDFs allow you to create custom functions to process records or groups of records. A UDF accepts parameters, performs work, and then returns a result. For examples and more information about UDFs, see Querying with user defined functions.
Related information
Amazon Athena UDF Connector (on GitHub)
Connect Amazon Athena to your Apache Hive metastore and use user defined functions