yuqi1129 commented on code in PR #12455:
URL: https://github.com/apache/gravitino/pull/12455#discussion_r3796370695
##########
core/src/main/java/org/apache/gravitino/storage/relational/service/CatalogMetaService.java:
##########
@@ -252,18 +264,15 @@ public boolean deleteCatalog(NameIdentifier identifier,
boolean cascade) {
NameIdentifierUtil.checkCatalog(identifier);
String catalogName = identifier.name();
- long catalogId = EntityIdService.getEntityId(identifier,
Entity.EntityType.CATALOG);
+ CatalogPO catalogPO = getCatalogPOByName(identifier.namespace().level(0),
catalogName);
+ long catalogId = catalogPO.getCatalogId();
if (cascade) {
SessionUtils.doMultipleWithCommit(
- () ->
- SessionUtils.doWithoutCommit(
- CatalogMetaMapper.class,
- mapper ->
mapper.softDeleteCatalogMetasByCatalogId(catalogId)),
- () ->
- SessionUtils.doWithoutCommit(
- SchemaMetaMapper.class,
- mapper ->
mapper.softDeleteSchemaMetasByCatalogId(catalogId)),
+ () -> {
+ deleteCatalogWithVersion(identifier, catalogPO);
Review Comment:
Add comments that are easy to read.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]