anoopj commented on code in PR #15049: URL: https://github.com/apache/iceberg/pull/15049#discussion_r2978431994
########## 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: Good observation. DeletionVector.OFFSET does reuse field ID 144 from DataFile.CONTENT_OFFSET. The field name is shortened to offset because within the deletion_vector struct context since "content_offset" is redundant. ########## 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: These are different fields with different IDs. FILE_PATH is field 100 (the data file's location at the TrackedFile level) while DeletionVector.LOCATION is field 155 (the Puffin file containing the DV blob). Hope that made sense. ########## 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: The relationship looks inverted from v2/v3 but I think it's the right shape for v4. In v4, the entry is the primary entity. A single entry can represent a data file with an attached DV, column files, and manifest-level metadata. The tracking info (status, snapshots, sequences, etc) is one attribute of the entry rather than a wrapper around it. That's why Tracking is a nested struct inside the entry rather than the other way around. -- 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]
