Skip to content

Commit

Permalink
impl
Browse files Browse the repository at this point in the history
  • Loading branch information
lzlfred committed Nov 5, 2024
1 parent 6ae4b62 commit 77f186c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,12 @@ case class CreateDeltaTableCommand(
val txn = deltaLog.startTransaction(None, snapshotOpt)
validatePrerequisitesForClusteredTable(txn.snapshot.protocol, txn.deltaLog)

// During CREATE (not REPLACE/overwrites), we synchronously run conversion
// If its REPLACE or dataframe overwrite, and the table does not exist yet, or
// its CREATE without 'OR REPLACE', we synchronously run conversion
// (if Uniform is enabled) so we always remove the post commit hook here.
if (!isReplace) {
val tableExistsInCatalog = sparkSession.sessionState.managedCatalogSessionCatalog
.tableExists(tableWithLocation.identifier)
if (!isReplace || !tableExistsInCatalog) {
txn.unregisterPostCommitHooksWhere(hook => hook.name == IcebergConverterHook.name)
txn.unregisterPostCommitHooksWhere(hook => hook.name == HudiConverterHook.name)
}
Expand Down

0 comments on commit 77f186c

Please sign in to comment.