Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
5.0.0
-
None
-
-
Important
Description
I built an udf `ARRAY_DISTINCT`, When i exec:
① SELECT ARRAY_DISTINCT(ARRAY['A', 'B', 'A', 'C'], TRUE);
throw error:
org.apache.phoenix.schema.FunctionNotFoundException: ERROR 6001 (42F01): Function undefined. functionName=ARRAY_DISTINCT at org.apache.phoenix.compile.FromCompiler$1.resolveFunction(FromCompiler.java:134) at org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:327)
However when i exec:
② SELECT ARRAY_DISTINCT(ARRAY['A', 'B', 'A', 'C'], TRUE) FROM TABLE_NAME;
output:
---------------------
| ARRAY['A','B','C'] |
---------------------
---------------------
③ SELECT ARRAY_DISTINCT(array_elements, TRUE) as arr FROM TABLE_NAME;**
output:
---------------------
| ARR |
---------------------
| ARRAY['A','B','C'] |**
---------------------
The DDL:
CREATE FUNCTION ARRAY_DISTINCT(VARCHAR[], BOOLEAN) RETURNS VARCHAR AS 'com.godalgo.udf.ArrayDistinctFunction';
My Environment: apache-phoenix-5.0.0-HBase-2.0-bin hbase-2.0.0 hadoop-3.1.0
I tried the built-in functions which provided by Phoenix, ALL OF THEM ARE OK .
I had putted ARRAY_DISTINCT's SOURCE TO attachment.