aokolnychyi commented on code in PR #4870: URL: https://github.com/apache/iceberg/pull/4870#discussion_r911418335
########## api/src/main/java/org/apache/iceberg/ChangelogScanTask.java: ########## @@ -0,0 +1,40 @@ +/* + * 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; + +/** + * A changelog scan task. + */ +public interface ChangelogScanTask extends FileScanTask { + /** + * Returns the operation type (i.e. insert/delete). + */ + ChangelogOperation operation(); + + /** + * Returns the relative commit order in which the changes must be applied. + */ + int commitOrder(); + + /** + * Returns the snapshot ID in which the changes were committed. + */ + long commitSnapshotId(); Review Comment: @flyrain @rdblue, I agree with you but what about `DeletedRowsScanTask`? Suppose I have a data file `file_A`: ``` id -- 1 2 3 4 5 ``` And then I have two delete snapshots S1 and S2. S1 deletes IDs 1, 2 and S2 deletes IDs 3, 4. If we are to assign snapshot IDs to tasks, we will have to produce two `DeletedRowsScanTask`s: ``` file_A & deletes from S1 (inherit the snapshot ID and commit order from S1) file_A & deletes from S2 (inherit the snapshot ID and commit order from S2) ``` Even if we combine these two tasks in one group, it will be suboptimal as we will scan through the same data file twice. It would be more efficient to combine these deletes against the same data file and do one pass to determine deleted records. -- 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]
