gaborkaszab commented on code in PR #16849:
URL: https://github.com/apache/iceberg/pull/16849#discussion_r3434092328
##########
core/src/main/java/org/apache/iceberg/TrackingStruct.java:
##########
@@ -130,6 +130,13 @@ void inheritFrom(Tracking manifestTracking) {
}
}
+ void setFirstRowId(Long newFirstRowId) {
+ Preconditions.checkArgument(newFirstRowId != null, "Invalid first row ID:
null");
Review Comment:
Good point! done
##########
core/src/test/java/org/apache/iceberg/TestTrackingStruct.java:
##########
@@ -211,6 +211,58 @@ void testInheritFromNullIsNoOp() {
assertThat(tracking.fileSequenceNumber()).isNull();
}
+ @Test
+ public void testFirstRowIdIsNullInitially() {
+ TrackingStruct source = (TrackingStruct) TrackingBuilder.added(5L).build();
+ source.set(DATA_SEQUENCE_NUMBER_ORDINAL, 10L);
+ source.set(FILE_SEQUENCE_NUMBER_ORDINAL, 11L);
+
+ assertThat(source.firstRowId()).isNull();
+
+ TrackingStruct existing = (TrackingStruct) TrackingBuilder.from(source,
20L).build();
+
+ assertThat(existing.firstRowId()).isNull();
+ }
+
+ @Test
+ public void testSettingFirstRowId() {
Review Comment:
I changed one of the tests to use zero for input. Thx
##########
core/src/main/java/org/apache/iceberg/TrackingStruct.java:
##########
@@ -130,6 +130,13 @@ void inheritFrom(Tracking manifestTracking) {
}
}
+ void setFirstRowId(Long newFirstRowId) {
+ Preconditions.checkArgument(newFirstRowId != null, "Invalid first row ID:
null");
+ Preconditions.checkArgument(newFirstRowId >= 0, "Invalid first row ID:
negative");
Review Comment:
thx, done
--
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]