public class Deletes
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static CloseableIterable<java.lang.Long> |
deletePositions(java.lang.CharSequence dataLocation,
CloseableIterable<StructLike> deleteFile) |
static <T extends StructLike> |
deletePositions(java.lang.CharSequence dataLocation,
java.util.List<CloseableIterable<T>> deleteFiles) |
static <T> CloseableIterable<T> |
filter(CloseableIterable<T> rows,
java.util.function.Function<T,StructLike> rowToDeleteKey,
StructLikeSet deleteSet) |
static <T> CloseableIterable<T> |
filterDeleted(CloseableIterable<T> rows,
java.util.function.Predicate<T> isDeleted,
DeleteCounter counter)
Returns the remaining rows (the ones that are not deleted), while counting the deleted ones.
|
static <T> CloseableIterable<T> |
markDeleted(CloseableIterable<T> rows,
java.util.function.Predicate<T> isDeleted,
java.util.function.Consumer<T> deleteMarker)
Returns the same rows that are input, while marking the deleted ones.
|
static <T> CloseableIterable<T> |
streamingFilter(CloseableIterable<T> rows,
java.util.function.Function<T,java.lang.Long> rowToPosition,
CloseableIterable<java.lang.Long> posDeletes) |
static <T> CloseableIterable<T> |
streamingFilter(CloseableIterable<T> rows,
java.util.function.Function<T,java.lang.Long> rowToPosition,
CloseableIterable<java.lang.Long> posDeletes,
DeleteCounter counter) |
static <T> CloseableIterable<T> |
streamingMarker(CloseableIterable<T> rows,
java.util.function.Function<T,java.lang.Long> rowToPosition,
CloseableIterable<java.lang.Long> posDeletes,
java.util.function.Consumer<T> markDeleted) |
static StructLikeSet |
toEqualitySet(CloseableIterable<StructLike> eqDeletes,
Types.StructType eqType) |
static <T extends StructLike> |
toPositionIndex(java.lang.CharSequence dataLocation,
java.util.List<CloseableIterable<T>> deleteFiles) |
static <T extends StructLike> |
toPositionIndex(java.lang.CharSequence dataLocation,
java.util.List<CloseableIterable<T>> deleteFiles,
java.util.concurrent.ExecutorService deleteWorkerPool) |
static PositionDeleteIndex |
toPositionIndex(CloseableIterable<java.lang.Long> posDeletes) |
static <T extends StructLike> |
toPositionIndexes(CloseableIterable<T> posDeletes)
Builds a map of position delete indexes by path.
|
public static <T> CloseableIterable<T> filter(CloseableIterable<T> rows, java.util.function.Function<T,StructLike> rowToDeleteKey, StructLikeSet deleteSet)
public static <T> CloseableIterable<T> markDeleted(CloseableIterable<T> rows, java.util.function.Predicate<T> isDeleted, java.util.function.Consumer<T> deleteMarker)
rows
- the rows to processisDeleted
- a predicate that determines if a row is deleteddeleteMarker
- a function that marks a row as deletedpublic static <T> CloseableIterable<T> filterDeleted(CloseableIterable<T> rows, java.util.function.Predicate<T> isDeleted, DeleteCounter counter)
rows
- the rows to processisDeleted
- a predicate that determines if a row is deletedcounter
- a counter that counts deleted rowspublic static StructLikeSet toEqualitySet(CloseableIterable<StructLike> eqDeletes, Types.StructType eqType)
public static <T extends StructLike> CharSequenceMap<PositionDeleteIndex> toPositionIndexes(CloseableIterable<T> posDeletes)
Unlike toPositionIndex(CharSequence, List)
, this method builds a position delete
index for each referenced data file and does not filter deletes. This can be useful when the
entire delete file content is needed (e.g. caching).
posDeletes
- position deletespublic static <T extends StructLike> PositionDeleteIndex toPositionIndex(java.lang.CharSequence dataLocation, java.util.List<CloseableIterable<T>> deleteFiles)
public static <T extends StructLike> PositionDeleteIndex toPositionIndex(java.lang.CharSequence dataLocation, java.util.List<CloseableIterable<T>> deleteFiles, java.util.concurrent.ExecutorService deleteWorkerPool)
public static PositionDeleteIndex toPositionIndex(CloseableIterable<java.lang.Long> posDeletes)
public static <T> CloseableIterable<T> streamingFilter(CloseableIterable<T> rows, java.util.function.Function<T,java.lang.Long> rowToPosition, CloseableIterable<java.lang.Long> posDeletes)
public static <T> CloseableIterable<T> streamingFilter(CloseableIterable<T> rows, java.util.function.Function<T,java.lang.Long> rowToPosition, CloseableIterable<java.lang.Long> posDeletes, DeleteCounter counter)
public static <T> CloseableIterable<T> streamingMarker(CloseableIterable<T> rows, java.util.function.Function<T,java.lang.Long> rowToPosition, CloseableIterable<java.lang.Long> posDeletes, java.util.function.Consumer<T> markDeleted)
public static CloseableIterable<java.lang.Long> deletePositions(java.lang.CharSequence dataLocation, CloseableIterable<StructLike> deleteFile)
public static <T extends StructLike> CloseableIterable<java.lang.Long> deletePositions(java.lang.CharSequence dataLocation, java.util.List<CloseableIterable<T>> deleteFiles)