Details
-
Sub-task
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
When try to call Hive's collect_list function, it'll throw the following exception:
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to [Ljava.lang.Object; at org.apache.flink.table.functions.hive.conversion.HiveInspectors.lambda$getConversion$7f882244$1(HiveInspectors.java:201) at org.apache.flink.table.functions.hive.HiveGenericUDAF.accumulate(HiveGenericUDAF.java:185) at LocalNoGroupingAggregateWithoutKeys$39.processElement(Unknown Source)
The reason is when the parameter is a single array, Flink calls udf.accumulate(AggregationBuffer, Array[Double]), at this point java's var-args will cast Array[Double] to Array[Object]and let it be Object... args.
public void accumulate(GenericUDAFEvaluator.AggregationBuffer acc, Object... inputs)
Then it will consider the elements in the array as parameters.
The exception will also happen for other similar Hive UDAF.
Attachments
Issue Links
- links to