amogh-jahagirdar commented on code in PR #12925:
URL: https://github.com/apache/iceberg/pull/12925#discussion_r2065195777


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/data/GenericsHelpers.java:
##########
@@ -289,11 +317,27 @@ private static void assertEqualsUnsafe(Type type, Object 
expected, Object actual
     }
 
     switch (type.typeId()) {
+      case LONG:
+        assertThat(actual).as("Should be a long").isInstanceOf(Long.class);
+        if (expected instanceof Integer) {
+          assertThat(actual).as("Values didn't match").isEqualTo(((Number) 
expected).longValue());
+        } else {
+          assertThat(actual).as("Primitive value should be equal to 
expected").isEqualTo(expected);
+        }
+        break;
+      case DOUBLE:
+        assertThat(actual).as("Should be a double").isInstanceOf(Double.class);
+        if (expected instanceof Float) {
+          assertThat(Double.doubleToLongBits((double) actual))
+              .as("Values didn't match")
+              .isEqualTo(Double.doubleToLongBits(((Number) 
expected).doubleValue()));
+        } else {
+          assertThat(actual).as("Primitive value should be equal to 
expected").isEqualTo(expected);
+        }
+        break;

Review Comment:
   Disregard, my first comment still stands.
   
   I confused myself, we only  do `testReadsForTypePromotedColumns` for the 
vectorized parquet reader test so it makes sense that this wasn't failing 
before because before we were calling `TestHelpers#assertEqualsUnsafe` which 
has this same logic to ensure the right assertions in the context of type 
promoted columns



-- 
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-unsubscr...@iceberg.apache.org

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


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

Reply via email to