Interface DeleteFiles
-
- All Superinterfaces:
PendingUpdate<Snapshot>
,SnapshotUpdate<DeleteFiles>
public interface DeleteFiles extends SnapshotUpdate<DeleteFiles>
API for deleting files from a table.This API accumulates file deletions, produces a new
Snapshot
of the table, and commits that snapshot as the current.When committing, these changes will be applied to the latest table snapshot. Commit conflicts will be resolved by applying the changes to the new latest snapshot and reattempting the commit.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DeleteFiles
caseSensitive(boolean caseSensitive)
Enables or disables case sensitive expression binding for methods that accept expressions.DeleteFiles
deleteFile(java.lang.CharSequence path)
Delete a file path from the underlying table.default DeleteFiles
deleteFile(DataFile file)
Delete a file tracked by aDataFile
from the underlying table.DeleteFiles
deleteFromRowFilter(Expression expr)
Delete files that match anExpression
on data rows from the table.-
Methods inherited from interface org.apache.iceberg.PendingUpdate
apply, commit, updateEvent
-
Methods inherited from interface org.apache.iceberg.SnapshotUpdate
deleteWith, set, stageOnly
-
-
-
-
Method Detail
-
deleteFile
DeleteFiles deleteFile(java.lang.CharSequence path)
Delete a file path from the underlying table.To remove a file from the table, this path must equal a path in the table's metadata. Paths that are different but equivalent will not be removed. For example, file:/path/file.avro is equivalent to file:///path/file.avro, but would not remove the latter path from the table.
- Parameters:
path
- a fully-qualified file path to remove from the table- Returns:
- this for method chaining
-
deleteFile
default DeleteFiles deleteFile(DataFile file)
Delete a file tracked by aDataFile
from the underlying table.- Parameters:
file
- a DataFile to remove from the table- Returns:
- this for method chaining
-
deleteFromRowFilter
DeleteFiles deleteFromRowFilter(Expression expr)
Delete files that match anExpression
on data rows from the table.A file is selected to be deleted by the expression if it could contain any rows that match the expression (candidate files are selected using an
inclusive projection
). These candidate files are deleted if all of the rows in the file must match the expression (the partition data matches the expression'sProjections.strict(PartitionSpec)
strict projection}). This guarantees that files are deleted if and only if all rows in the file must match the expression.Files that may contain some rows that match the expression and some rows that do not will result in a
ValidationException
.- Parameters:
expr
- an expression on rows in the table- Returns:
- this for method chaining
- Throws:
ValidationException
- If a file can contain both rows that match and rows that do not
-
caseSensitive
DeleteFiles caseSensitive(boolean caseSensitive)
Enables or disables case sensitive expression binding for methods that accept expressions.- Parameters:
caseSensitive
- whether expression binding should be case sensitive- Returns:
- this for method chaining
-
-