Ruan-Xin commented on a change in pull request #11876:
URL: https://github.com/apache/flink/pull/11876#discussion_r416283231
##########
File path:
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/table/functions/hive/HiveSimpleUDFTest.java
##########
@@ -49,6 +50,30 @@
public class HiveSimpleUDFTest {
private static HiveShim hiveShim =
HiveShimLoader.loadHiveShim(HiveShimLoader.getHiveVersion());
+ @Test
+ public void testBooleanUDF() {
+ HiveSimpleUDF udf = init(BooleanUDF.class, new DataType[]{
DataTypes.INT()});
+ assertTrue((boolean) udf.eval(1));
+ }
+
+ @Test
+ public void testFloatUDF() {
+ HiveSimpleUDF udf = init(FloatUDF.class, new DataType[]{
DataTypes.FLOAT()});
+ assertEquals((float) udf.eval(3.0f), 3.0f, 1.0);
Review comment:
the function need a positive delta
`static public void assertEquals(float expected, float actual, float delta)`
asserts that two floats are equal to within a positive delta.
I have set delta to 0
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]