Package io.delta.kernel
Interface CommitActions
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
CommitActionsImpl
Represents all actions from a single commit version in a table.
Resource Management:
- Each iterator returned by
getActions()must be closed after use to release underlying resources. - The
CommitActionsobject should be closed correctly (preferably using try-with-resources) to ensure any resources allocated during construction are properly released.
Example usage:
try (CommitActions commitActions = ...) {
long version = commitActions.getVersion();
long timestamp = commitActions.getTimestamp();
try (CloseableIterator<ColumnarBatch> actions = commitActions.getActions()) {
while (actions.hasNext()) {
ColumnarBatch batch = actions.next();
// process batch
}
}
}
- Since:
- 4.1.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns an iterator over the action batches for this commit.longReturns the commit timestamp in milliseconds since Unix epoch.longReturns the commit version number.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
getVersion
long getVersion()Returns the commit version number.- Returns:
- the version number of this commit
-
getTimestamp
long getTimestamp()Returns the commit timestamp in milliseconds since Unix epoch.- Returns:
- the timestamp of this commit
-
getActions
CloseableIterator<ColumnarBatch> getActions()Returns an iterator over the action batches for this commit.Each
ColumnarBatchcontains actions from this commit only.Note: All rows within all batches have the same version (returned by
getVersion()).This method can be called multiple times, and each call returns a new iterator over the same set of batches. This supports use cases like two-pass processing (e.g., validation pass followed by processing pass).
Callers are responsible for closing each iterator returned by this method. Each iterator must be closed after use to release underlying resources.
- Returns:
- a
CloseableIteratorover columnar batches containing this commit's actions
-