Class DeleteReader<T>
java.lang.Object
org.apache.beam.sdk.io.iceberg.cdc.DeleteReader<T>
- Direct Known Subclasses:
CdcReadUtils.GenericDeleteReader
Reads a
DataFile and returns records marked deleted by the given
DeleteFiles.
This is mostly a copy of DeleteFilter, but flipping the logic
to output deleted records instead of filtering them out.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDelete data already loaded by a planning/pushdown path for one task read. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeleteReader(String filePath, List<org.apache.iceberg.DeleteFile> deletes, org.apache.iceberg.Schema tableSchema, org.apache.iceberg.Schema expectedSchema, boolean needRowPosCol, DeleteReader.PreloadedDeletes preloadedDeletes) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.apache.iceberg.StructLikeasStructLike(T record) org.apache.iceberg.deletes.PositionDeleteIndexprotected abstract org.apache.iceberg.io.InputFilegetInputFile(String location) protected org.apache.iceberg.io.InputFileloadInputFile(org.apache.iceberg.DeleteFile deleteFile) protected org.apache.iceberg.data.DeleteLoaderprotected longorg.apache.iceberg.io.CloseableIterable<T> Returns records that are deleted by either the position deletes or the equality deletes attached to this reader — i.e.org.apache.iceberg.Schema
-
Constructor Details
-
DeleteReader
protected DeleteReader(String filePath, List<org.apache.iceberg.DeleteFile> deletes, org.apache.iceberg.Schema tableSchema, org.apache.iceberg.Schema expectedSchema, boolean needRowPosCol, DeleteReader.PreloadedDeletes preloadedDeletes)
-
-
Method Details
-
requiredSchema
public org.apache.iceberg.Schema requiredSchema() -
asStructLike
-
getInputFile
-
loadInputFile
protected org.apache.iceberg.io.InputFile loadInputFile(org.apache.iceberg.DeleteFile deleteFile) -
pos
-
newDeleteLoader
protected org.apache.iceberg.data.DeleteLoader newDeleteLoader() -
read
public org.apache.iceberg.io.CloseableIterable<T> read(org.apache.iceberg.io.CloseableIterable<T> records) Returns records that are deleted by either the position deletes or the equality deletes attached to this reader — i.e. the union of the two delete predicates.Each delete-type predicate is built independently and defaults to "false" (no contribution to the union) when its side has no delete files. Both predicates are then OR-combined and applied in a single pass over
records. This guarantees that:- A task with only position deletes emits all records whose position is in the index.
- A task with only equality deletes emits all records matching any equality delete value.
- A task with both emits the union of the two (without duplication).
-
deletedRowPositions
public org.apache.iceberg.deletes.PositionDeleteIndex deletedRowPositions()
-