I'm using Athena and trying to get a sum of array elements which are double but the reduce function seems to only work on integers:
SELECT reduce(ARRAY [5.0, 20.0, 50.4], 0, (s, x) -> s + x, s -> s);
Will throw an error:
Unexpected parameters (array(double), integer, com.facebook.presto.sql.analyzer.TypeSignatureProvider@762f0fa7, com.facebook.presto.sql.analyzer.TypeSignatureProvider@29dfe267) for function reduce. Expected: reduce(array(T), S, function(S,T,S), function(S,R)) T, S, R
Is there a way to do it?