You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "JanKaul (via GitHub)" <gi...@apache.org> on 2023/09/08 07:38:59 UTC

[GitHub] [iceberg-rust] JanKaul opened a new pull request, #57: Metadata integration tests

JanKaul opened a new pull request, #57:
URL: https://github.com/apache/iceberg-rust/pull/57

   This PR adds integration tests for reading the table metadata from files. Some of the tests are designed to fail. With the current design of the serialization/deserialization the error doesn't specify which field is missing. So I couldn't do a precise check for certain tests.


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


[GitHub] [iceberg-rust] Fokko merged pull request #57: Metadata integration tests

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


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


[GitHub] [iceberg-rust] liurenjie1024 commented on a diff in pull request #57: Metadata integration tests

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


##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -346,21 +349,29 @@ pub(super) mod _serde {
             } else {
                 value.current_snapshot_id
             };
+            let schemas = HashMap::from_iter(
+                value
+                    .schemas
+                    .into_iter()
+                    .map(|schema| Ok((schema.schema_id, Arc::new(schema.try_into()?))))
+                    .collect::<Result<Vec<_>, Error>>()?,
+            );
             Ok(TableMetadata {
                 format_version: FormatVersion::V2,
                 table_uuid: value.table_uuid,
                 location: value.location,
                 last_sequence_number: value.last_sequence_number,
                 last_updated_ms: value.last_updated_ms,
                 last_column_id: value.last_column_id,
-                schemas: HashMap::from_iter(
-                    value
-                        .schemas
-                        .into_iter()
-                        .map(|schema| Ok((schema.schema_id, Arc::new(schema.try_into()?))))
-                        .collect::<Result<Vec<_>, Error>>()?,
-                ),
-                current_schema_id: value.current_schema_id,
+                current_schema_id: if schemas.keys().contains(&value.current_schema_id) {
+                    Ok(value.current_schema_id)
+                } else {
+                    Err(self::Error::new(
+                        ErrorKind::DataInvalid,
+                        "No schema exists with the current schema id.",

Review Comment:
   ```suggestion
                           format!("No schema exists with the current schema id: {}", *value.current_schema_id),
   ```



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


[GitHub] [iceberg-rust] JanKaul commented on pull request #57: Metadata integration tests

Posted by "JanKaul (via GitHub)" <gi...@apache.org>.
JanKaul commented on PR #57:
URL: https://github.com/apache/iceberg-rust/pull/57#issuecomment-1711222438

   @liurenjie1024, @Xuanwo , @Fokko it would be great if you could take a look.


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