stevenzwu commented on code in PR #15049:
URL: https://github.com/apache/iceberg/pull/15049#discussion_r2969163382


##########
core/src/main/java/org/apache/iceberg/TrackedFile.java:
##########
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import org.apache.iceberg.stats.ContentStats;
+import org.apache.iceberg.types.Types;
+
+/** A file tracked by a v4 manifest. */
+interface TrackedFile {
+  Types.NestedField TRACKING =
+      Types.NestedField.required(
+          147, "tracking", Tracking.schema(), "Tracking information for this 
entry");

Review Comment:
   it seems that the wrapping relationship inverted here. If I understand it 
correctly, `Tracking` is like the old `ManifestEntry` and `TrackingFile` is 
like the old `ContentFile`.
   
   Previously, `ManifestEntry` wraps `ContentFile`. Now, we have `TrackingFile` 
wrap `ManifestEntry`.
   
   I feel the V4 manifest entry should wrap three parts
   
   - Data file with data and file sequence numbers, snapshot ids etc.
   - DV with file sequence number for the snapshot that DV is added.
   - an array of column files. Each column file has its own file sequence 
number for the snapshot that the column file is added.



##########
core/src/main/java/org/apache/iceberg/DeletionVector.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import org.apache.iceberg.types.Types;
+
+/**
+ * Metadata about a deletion vector (DV) associated with a data file entry.
+ *
+ * <p>In the combined entry model, each DATA entry may optionally carry DV 
information. The DV
+ * content is stored at the specified location, offset, and size.
+ *
+ * <p>This struct may only be defined when content_type is DATA (0), and must 
be null for all other
+ * content types.
+ */
+interface DeletionVector {
+  Types.NestedField LOCATION =
+      Types.NestedField.required(
+          155, "location", Types.StringType.get(), "Location of the file 
containing the DV");

Review Comment:
   why not using existing field?
   
   ```
   Types.NestedField FILE_PATH =
         required(100, "file_path", StringType.get(), "Location URI with FS 
scheme");
   ```



##########
core/src/main/java/org/apache/iceberg/DeletionVector.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import org.apache.iceberg.types.Types;
+
+/**
+ * Metadata about a deletion vector.
+ *
+ * <p>Tracks where a DV blob can be read. The DV blob follows the format 
defined by the
+ * deletion-vector-v1 blob type in the Puffin spec.
+ */
+interface DeletionVector {
+  Types.NestedField LOCATION =
+      Types.NestedField.required(
+          155, "location", Types.StringType.get(), "Location of the file 
containing the DV");
+  Types.NestedField OFFSET =

Review Comment:
   what about reusing existing definition?
   
   ```
     Types.NestedField CONTENT_OFFSET =
         optional(
             144, "content_offset", LongType.get(), "The offset in the file 
where the content starts");
   ```



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