You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/10/06 11:11:28 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #5928: API: Handle negative/zero during num-digits calculation

nastra commented on code in PR #5928:
URL: https://github.com/apache/iceberg/pull/5928#discussion_r988900777


##########
api/src/test/java/org/apache/iceberg/expressions/TestExpressionUtil.java:
##########
@@ -63,6 +64,23 @@ public void testSanitizeIn() {
         ExpressionUtil.toSanitizedString(Expressions.in("test", 34, 345)));
   }
 
+  @Test
+  public void zeroAndNegativeNumberHandling() {
+    Assertions.assertThat(
+            ExpressionUtil.toSanitizedString(
+                Expressions.in(
+                    "test",
+                    0,
+                    Integer.MIN_VALUE,
+                    Integer.MAX_VALUE,
+                    Float.MIN_VALUE,
+                    Float.MAX_VALUE,
+                    Double.MIN_VALUE,
+                    Double.MAX_VALUE)))
+        .isEqualTo(
+            "test IN ((1-digit-int), (10-digit-int), (10-digit-int), (45-digit-float), (39-digit-float), (324-digit-float), (309-digit-float))");

Review Comment:
   I'm currently not sure if Float.MIN_VALUE / Double.MIN_VALUE are correctly calculated here



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org