flyrain commented on code in PR #4870: URL: https://github.com/apache/iceberg/pull/4870#discussion_r895070981
########## api/src/main/java/org/apache/iceberg/DeletedRowsScanTask.java: ########## @@ -0,0 +1,30 @@ +/* + * 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 scan task for deleted data records generated by adding delete files to the table. + */ +public interface DeletedRowsScanTask extends ChangelogScanTask { Review Comment: Let's say we delete a row r1 in s1, and delete it again in s2. We will get two CDC delete records, one from s1, another from s2, as you pointed out. The second CDC delete record could be considered as a no-op, which is probably fine(I will come back with an edge case). The problem happens when we only generate CDC records from s2. How do we handle the deleted row r1 in s2? Do we output it or not? It is confusing if we output it since it is really a no-op. The edge case is that there are two same rows in the data files(r1, r2). We don't know whether r1 is deleted twice or both r1 and r2 are deleted if we output duplicated delete cdc records. Unless we project row pos and data file name in cdc records, which sounds weird, and exposes two much internal implementation details. -- 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]
