I'm trying to return an array of Floats in a Java UDF, but Snowflake throws an error:
create or replace function float_array_test()
returns array
language java
handler='MyClass.test'
as
$$
class MyClass {
public static Float[] test() {
return new Float[] {1.1, 2.2};
}
}
$$;
Error:
100315 (P0000): Error while compiling source: /InlineCode.java:4: error: incompatible types: double cannot be converted to Float
return new Float[] {1.1, 2.2};
Any way to fix?