PostCommitHook — Post-Commit Hooks

PostCommitHook is an abstraction of post-commit hooks that have a user-friendly name and can be executed (when OptimisticTransactionImpl is committed).

Table 1. PostCommitHook Contract
Method Description

handleError

handleError(
  error: Throwable,
  version: Long): Unit = {}

Handles an error while running the post-commit hook

Used when OptimisticTransactionImpl is requested to run post-commit hooks (when committed)

name

name: String

User-friendly name of the hook for error reporting

Used when:

run

run(
  spark: SparkSession,
  txn: OptimisticTransactionImpl,
  committedActions: Seq[Action]): Unit

Executes the post-commit hook

Used when OptimisticTransactionImpl is requested to run post-commit hooks (when committed)

GenerateSymlinkManifestImpl is the default and only known PostCommitHook in Delta Lake.