You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "c-thiel (via GitHub)" <gi...@apache.org> on 2025/04/05 10:32:56 UTC

[PR] fix: TableMetadata max sequence number validation [iceberg-rust]

c-thiel opened a new pull request, #1167:
URL: https://github.com/apache/iceberg-rust/pull/1167

   ## What changes are included in this PR?
   Ensures that the sequence number of any snapshot in TableMetadata is lower or equal to the `last_sequence_number`.
   
   In Java this happens during indexing:
   https://github.com/apache/iceberg/blob/0152075268851d397b60bcb66e5a7c346271dfd9/core/src/main/java/org/apache/iceberg/TableMetadata.java#L842
   


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

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


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


Re: [PR] fix: TableMetadata max sequence number validation [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 merged PR #1167:
URL: https://github.com/apache/iceberg-rust/pull/1167


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

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


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


Re: [PR] fix: TableMetadata max sequence number validation [iceberg-rust]

Posted by "c-thiel (via GitHub)" <gi...@apache.org>.
c-thiel commented on code in PR #1167:
URL: https://github.com/apache/iceberg-rust/pull/1167#discussion_r2031790551


##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -558,6 +558,24 @@ impl TableMetadata {
             ));
         }
 
+        if self.format_version >= FormatVersion::V2 && self.last_sequence_number < 0 {

Review Comment:
   Comparing with Java, I think we should remove the second condition after the && altogether.
   -1 is not a valid value.



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

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


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


Re: [PR] fix: TableMetadata max sequence number validation [iceberg-rust]

Posted by "c-thiel (via GitHub)" <gi...@apache.org>.
c-thiel commented on code in PR #1167:
URL: https://github.com/apache/iceberg-rust/pull/1167#discussion_r2031790551


##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -558,6 +558,24 @@ impl TableMetadata {
             ));
         }
 
+        if self.format_version >= FormatVersion::V2 && self.last_sequence_number < 0 {

Review Comment:
   Comparing with Java, I think we should remove the check altogether.
   -1 is not a valid value.



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

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


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


Re: [PR] fix: TableMetadata max sequence number validation [iceberg-rust]

Posted by "c-thiel (via GitHub)" <gi...@apache.org>.
c-thiel commented on code in PR #1167:
URL: https://github.com/apache/iceberg-rust/pull/1167#discussion_r2031777168


##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -558,6 +558,24 @@ impl TableMetadata {
             ));
         }
 
+        if self.format_version >= FormatVersion::V2 && self.last_sequence_number < 0 {

Review Comment:
   You are right, what a stupid error.
   Fixed it and also added a test



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

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


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


Re: [PR] fix: TableMetadata max sequence number validation [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 commented on code in PR #1167:
URL: https://github.com/apache/iceberg-rust/pull/1167#discussion_r2031213325


##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -558,6 +558,24 @@ impl TableMetadata {
             ));
         }
 
+        if self.format_version >= FormatVersion::V2 && self.last_sequence_number < 0 {

Review Comment:
   ```suggestion
           if self.format_version >= FormatVersion::V2 && self.last_sequence_number < 0 {
   ```
   Why `last_sequence_number` must be zero? I think it should be `>0`?



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

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


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