rdblue commented on code in PR #3432: URL: https://github.com/apache/iceberg/pull/3432#discussion_r841286552
########## site/docs/row-level-deletes.md: ########## @@ -0,0 +1,190 @@ +<!-- + - 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. + --> + +# Row-Level Deletes + +Iceberg supports metadata-based deletion through the `DeleteFiles` interface. +It allows you to quickly delete a specific file or any file that might match a given expression without the need to read or write any data in the table. + +Row-level deletes target more complicated use cases such as general data protection regulation (GDPR). +Copy-on-write and merge-on-read are two different approaches to handle row-level delete operations. Here are their definitions in Iceberg: + +- **copy-on-write**: a delete directly rewrites all the affected data files. +- **merge-on-read**: delete information is encoded in the form of _delete files_. The table reader can apply all delete information at read time. + +Overall, copy-on-write is more efficient in reading data, whereas merge-on-read is more efficient in writing deletes, but requires more maintenance and tuning to be performant in reading data with deletes. +Users can choose to use **both** copy-on-write and merge-on-read for the same Iceberg table based on different situations. +For example, a time-partitioned table can have newer partitions maintained with the merge-on-read approach through a streaming pipeline, +and older partitions maintained with the copy-on-write approach to apply less frequent GDPR deletes from batch ETL jobs. + +There are use cases that could only be supported by one approach such as change data capture (CDC). Review Comment: I don't think this statement is true. A large `MERGE INTO` can definitely be used. You probably mean low latency CDC? -- 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: dev-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org