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 2021/01/15 20:31:44 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #2091: Spark - Fix parquet vectorized reads when column types are promoted

rdblue commented on a change in pull request #2091:
URL: https://github.com/apache/iceberg/pull/2091#discussion_r558577297



##########
File path: spark/src/test/java/org/apache/iceberg/spark/data/TestHelpers.java
##########
@@ -267,11 +267,23 @@ private static void assertEqualsUnsafe(Type type, Object expected, Object actual
     }
 
     switch (type.typeId()) {
-      case BOOLEAN:
       case INTEGER:
+        Assert.assertEquals("Values didn't match", ((Number) expected).intValue(),
+                ((Number) actual).intValue());
+        break;
       case LONG:
+        Assert.assertEquals("Values didn't match", ((Number) expected).longValue(),
+                ((Number) actual).longValue());
+        break;
       case FLOAT:
+        Assert.assertEquals("Values didn't match", ((Number) expected).floatValue(),
+                ((Number) actual).floatValue(), 0.01F);

Review comment:
       We generally don't use `assertEquals` that has a floating point tolerance because Iceberg does not calculate values. The values should match exactly. I think this should use `Float.floatToIntBits` and compare the integer results.




----------------------------------------------------------------
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:
users@infra.apache.org



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