Creates a new OptimisticTransaction.
Creates a new OptimisticTransaction.
The Delta Log for the table this transaction is modifying.
The Delta Log for the table this transaction is modifying.
The snapshot that this transaction is reading at.
Looks at actions that have happened since the txn started and checks for logical conflicts with the read/writes.
Looks at actions that have happened since the txn started and checks for logical conflicts with the read/writes. If no conflicts are found, try to commit again otherwise, throw an exception.
Modifies the state of the log by adding a new commit that is based on a read at
the given lastVersion
.
Modifies the state of the log by adding a new commit that is based on a read at
the given lastVersion
. In the case of a conflict with a concurrent writer this
method will throw an exception.
Set of actions to commit
Details of operation that is performing this transactional commit
Tracks if this transaction has already committed.
Tracks if this transaction has already committed.
The Delta Log for the table this transaction is modifying.
The Delta Log for the table this transaction is modifying.
Tracks if this transaction depends on any data files.
Tracks if this transaction depends on any data files. This flag must be set if this transaction reads any data explicitly or implicitly (e.g., delete, update and overwrite).
Returns files matching the given predicates.
Returns files matching the given predicates.
Returns files matching the given predicates.
Returns files matching the given predicates.
Makes the output attributes nullable, so that we don't write unreadable parquet files.
Makes the output attributes nullable, so that we don't write unreadable parquet files.
Returns the metadata at the current point in the log.
Returns the metadata at the current point in the log.
Stores the updated metadata (if any) that will result from this txn.
Stores the updated metadata (if any) that will result from this txn.
Normalize the schema of the query, and return the QueryExecution to execute.
Normalize the schema of the query, and return the QueryExecution to execute. The output
attributes of the QueryExecution may not match the attributes we return as the output schema.
This is because streaming queries create IncrementalExecution
, which cannot be further
modified. We can however have the Parquet writer use the physical plan from
IncrementalExecution
and the output schema provided through the attributes.
Perform post-commit operations
Perform post-commit operations
Prepare for a commit by doing all necessary pre-commit checks and modifications to the actions.
Prepare for a commit by doing all necessary pre-commit checks and modifications to the actions.
The finalized set of actions.
The protocol of the snapshot that this transaction is reading at.
The protocol of the snapshot that this transaction is reading at.
Tracks the appIds that have been seen by this transaction.
Tracks the appIds that have been seen by this transaction.
The version that this transaction is reading from.
The version that this transaction is reading from.
Mark the entire table as tainted by this transaction.
Mark the entire table as tainted by this transaction.
Used to record the occurrence of a single event or report detailed, operation specific statistics.
Used to record the occurrence of a single event or report detailed, operation specific statistics.
Used to report the duration as well as the success or failure of an operation.
Used to report the duration as well as the success or failure of an operation.
The snapshot that this transaction is reading at.
The snapshot that this transaction is reading at.
For new tables, fetch global configs as metadata.
For new tables, fetch global configs as metadata.
Returns the latest version that has committed for the idempotent transaction with given id
.
Returns the latest version that has committed for the idempotent transaction with given id
.
Records an update to the metadata that should be committed with this transaction.
Records an update to the metadata that should be committed with this transaction. Note that this must be done before writing out any files so that file writing and checks happen with the final metadata for the table.
IMPORTANT: It is the responsibility of the caller to ensure that files currently present in the table are still valid under the new metadata.
Report a log to indicate some command is running.
Report a log to indicate some command is running.
Writes out the dataframe after performing schema validation.
Writes out the dataframe after performing schema validation. Returns a list of actions to append these files to the reservoir.
Used to perform a set of reads in a transaction and then commit a set of updates to the state of the log. All reads from the DeltaLog, MUST go through this instance rather than directly to the DeltaLog otherwise they will not be check for logical conflicts with concurrent updates.
This class is not thread-safe.