diqiu50 commented on code in PR #10738:
URL: https://github.com/apache/gravitino/pull/10738#discussion_r3094396093
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -877,9 +879,37 @@ private boolean containsUserCreatedSchemas(
Set<String> availableSchemaNames =
Arrays.stream(allSchemas).map(NameIdentifier::name).collect(Collectors.toSet());
- // some schemas are dropped externally, but still exist in the entity
store, those schemas are
- // invalid
- return
schemaEntities.stream().map(SchemaEntity::name).anyMatch(availableSchemaNames::contains);
+ // Some schemas are dropped externally, but still exist in the entity
store — those are invalid.
+ // Among schemas that still exist in the underlying catalog, only count
those created via
+ // Gravitino. New schemas carry an entity-store marker; older schemas fall
back to the embedded
+ // StringIdentifier in external catalog metadata.
+ for (SchemaEntity schemaEntity : schemaEntities) {
+ if (!availableSchemaNames.contains(schemaEntity.name())) {
+ continue;
+ }
+
+ Map<String, String> entityProps = schemaEntity.properties();
+ if (entityProps != null
+ &&
SchemaOperationDispatcher.SCHEMA_CREATED_BY_GRAVITINO_VALUE.equals(
+
entityProps.get(SchemaOperationDispatcher.SCHEMA_CREATED_BY_GRAVITINO))) {
+ return true;
Review Comment:
This is not a problem here, since schemas are not deleted.
--
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]