kbendick commented on code in PR #4716:
URL: https://github.com/apache/iceberg/pull/4716#discussion_r875239674
##########
core/src/test/java/org/apache/iceberg/TestMetadataUpdateParser.java:
##########
@@ -350,9 +485,51 @@ private static void assertEqualsAddSortOrder(
UnboundSortOrder.UnboundSortField actualField =
actual.sortOrder().fields().get(i);
Assert.assertTrue("Fields of the sort order should be the same",
expectedField.sourceId() == actualField.sourceId() &&
- expectedField.nullOrder().equals(actualField.nullOrder()) &&
- expectedField.direction().equals(actualField.direction()) &&
- Objects.equals(expectedField.transformAsString(),
actualField.transformAsString()));
+ expectedField.nullOrder().equals(actualField.nullOrder()) &&
+ expectedField.direction().equals(actualField.direction()) &&
+ Objects.equals(expectedField.transformAsString(),
actualField.transformAsString()));
});
}
+
+ private static void assertEqualsSetDefaultSortOrder(
+ MetadataUpdate.SetDefaultSortOrder expected,
MetadataUpdate.SetDefaultSortOrder actual) {
+ Assert.assertEquals("Sort order id should be the same",
expected.sortOrderId(), actual.sortOrderId());
+ }
+
+ // TODO - Come back to this when FileIO is injected. If this class extends
TableTestBase, the validateSnapshot
+ // methods can be reused. Also, this needs to handle V1 vs V2 for
assertions. Or casting to BaseSnapshot,
+ // BaseSnapshot::equals can be used.
+ private static void assertEqualsAddSnapshot(
+ MetadataUpdate.AddSnapshot expected, MetadataUpdate.AddSnapshot actual) {
+ Assert.fail("MetadataUpdate equality checking for AddSnapshot is not
implemented yet");
+ }
Review Comment:
TODO / Follow up - Come back to this when FileIO is injected. If this class
extends TableTestBase, the validateSnapshot methods can be reused. Also, this
possibly needs to handle the difference between V1 vs V2 for assertions. Or
casting to BaseSnapshot, BaseSnapshot::equals can be used.
Happy to remove this in this PR and handle `EqualsAddSnapshot` in another PR.
--
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]