kamcheungting-db commented on code in PR #14262:
URL: https://github.com/apache/iceberg/pull/14262#discussion_r2476467520


##########
core/src/test/java/org/apache/iceberg/TestContentFileParser.java:
##########
@@ -90,6 +92,29 @@ public void testDeleteFile(PartitionSpec spec, DeleteFile 
deleteFile, String exp
     assertContentFileEquals(deleteFile, deserializedContentFile, spec);
   }
 
+  @ParameterizedTest
+  @MethodSource("provideContentStatsAndDataFile")
+  public void testDataFileContentStats(PartitionSpec spec, DataFile dataFile, 
String expectedJson)
+        throws Exception {
+    String jsonStr = ContentFileParser.toJson(dataFile, spec);
+    assertThat(jsonStr).isEqualTo(expectedJson);
+    JsonNode jsonNode = JsonUtil.mapper().readTree(jsonStr);
+    ContentFile<?> deserializedContentFile =
+          ContentFileParser.fromJson(jsonNode, Map.of(TestBase.SPEC.specId(), 
spec));
+    assertThat(deserializedContentFile).isInstanceOf(DataFile.class);
+    assertContentFileEquals(dataFile, deserializedContentFile, spec);

Review Comment:
   Done, add validation of content stats to assertContentFileEquals



-- 
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]

Reply via email to