szehon-ho commented on code in PR #4898:
URL: https://github.com/apache/iceberg/pull/4898#discussion_r890629572


##########
api/src/main/java/org/apache/iceberg/ContentFile.java:
##########
@@ -39,6 +39,13 @@
    */
   int specId();
 
+  /**
+   * Return id of the schema when write this file.
+   */
+  default int schemaId() {
+    return -1;

Review Comment:
   Cant we use Preconditions, or just throw a runtimeException?



##########
api/src/main/java/org/apache/iceberg/ManifestFile.java:
##########
@@ -64,14 +64,15 @@ public interface ManifestFile {
       "Summary for each partition");
   Types.NestedField KEY_METADATA = optional(519, "key_metadata", 
Types.BinaryType.get(),
       "Encryption key metadata blob");
-  // next ID to assign: 520
+  Types.NestedField SCHEMA_ID = optional(520, "schema_id", 
Types.IntegerType.get(), "Schema ID");

Review Comment:
   Agree with @rdblue , I think having a datafile filtering is good for the 
first cut, as having manifest file keep schema id seems hard to get right and 
maintain, especially as any bug here is a bit risky and tricky, so definitely 
prefer simple approach first.



##########
api/src/main/java/org/apache/iceberg/DataFile.java:
##########
@@ -63,18 +63,20 @@ public interface DataFile extends ContentFile<DataFile> {
       "Equality comparison field IDs");
   Types.NestedField SORT_ORDER_ID = optional(140, "sort_order_id", 
IntegerType.get(), "Sort order ID");
   Types.NestedField SPEC_ID = optional(141, "spec_id", IntegerType.get(), 
"Partition spec ID");
+  Types.NestedField SCHEMA_ID = optional(142, "schema_id", IntegerType.get(), 
"Schema ID");

Review Comment:
   Note: it may need a follow up note in spec that 142 field is reserved, like: 
https://github.com/apache/iceberg/pull/4750



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