Skip to content

Commit

Permalink
Add initial implementation for integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingjian Wu committed Jun 2, 2024
1 parent 4ba9a32 commit 3136df9
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private void saveParentChildRelationship(final QualifiedName child, final TableD
child, child, parent);
delete(child);
} catch (Exception deleteException) {
log.error("Fail to deleteTable = {} after failing to save the parent child relationship "
log.error("Fail to deleteTable = {} after failing to update it's parent child relation "
+ "for child={}, parent={}",
child, child, parent, deleteException);
}
Expand Down Expand Up @@ -355,9 +355,15 @@ public TableDto deleteAndReturn(final QualifiedName name, final boolean isMView)
try {
parentChildRelMetadataService.drop(name);
} catch (Exception e) {
log.error("Fail to drop parent child relation for table = {}", name, e);
try {
connectorTableServiceProxy.create(name, converterUtil.fromTableDto(tableDto));
} catch (Exception tableCreationException) {
log.error("Fail to recreate table={} with tableDto={} "
+ "after failing to update it's parent child relation",
name, metacatJson.toJsonString(tableDto), tableCreationException);
}
throw e;
}

// If this is a common view, the storage_table if present
// should also be deleted.
if (MetacatUtils.isCommonView(tableDto.getMetadata())
Expand Down Expand Up @@ -541,7 +547,7 @@ public void rename(
// rename the parent back if fail to update parent child relation
connectorTableServiceProxy.rename(newName, oldName, isMView);
} catch (Exception renameException) {
log.error("Fail to rename from {} to {} after failing to save the parent child relationship",
log.error("Fail to rename from {} to {} after failing to update it's parent child relation",
oldName, newName, renameException);
}
throw e;
Expand Down

0 comments on commit 3136df9

Please sign in to comment.