gortiz commented on code in PR #16431:
URL: https://github.com/apache/pinot/pull/16431#discussion_r2239962453
##########
pinot-udf-test/src/main/java/org/apache/pinot/udf/test/UdfTestFramework.java:
##########
@@ -278,11 +282,38 @@ private static Object canonizeObject(@Nullable Object
value) {
list.add(f);
}
return list;
+ } else if (componentType == byte.class) {
+ // Convert byte array to List<Byte> for consistency
+ byte[] byteArray = (byte[]) value;
+ ArrayList<Byte> list = new ArrayList<>(byteArray.length);
+ for (byte b : byteArray) {
+ list.add(b);
+ }
+ return list;
} else {
return Arrays.asList((Object[]) value);
}
}
return value;
}
}
+
+ private static int doubleCompare(double d1, double d2) {
+ double epsilon = 0.0001d;
+ if (d1 > d2) {
+ if (d1 * (1 - epsilon) > d2) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ if (d2 > d1) {
Review Comment:
I've just copied this code from DoubleComparisonUtil, which is not
accessible from this class. I didn't know the guava alternative. I totally
think we can reuse that code
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]