ebyhr commented on code in PR #16849:
URL: https://github.com/apache/iceberg/pull/16849#discussion_r3432226543


##########
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:
   +1 to make the parameter to `long`. 



##########
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:
   How about adding a test case for `setFirstRowId(0L)` to demonstrate the 
boundary of the `>= 0` check? 



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