This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 9bd14a0f77 Revert "[#10325] improvement: Fix schema metadata loss in
SchemaOperationDispatcher.alterSchema entity-store update path" (#10622)
9bd14a0f77 is described below
commit 9bd14a0f77cf1845fbf21df2ed05bd85ed263e51
Author: Lord of Abyss <[email protected]>
AuthorDate: Wed Apr 1 13:50:08 2026 +0800
Revert "[#10325] improvement: Fix schema metadata loss in
SchemaOperationDispatcher.alterSchema entity-store update path" (#10622)
Reverts apache/gravitino#10393
---
.../catalog/SchemaOperationDispatcher.java | 4 --
.../catalog/TestSchemaOperationDispatcher.java | 47 ----------------------
2 files changed, 51 deletions(-)
diff --git
a/core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java
b/core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java
index 6883ca4418..b61c99e0d7 100644
---
a/core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java
+++
b/core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java
@@ -274,10 +274,6 @@ public class SchemaOperationDispatcher extends
OperationDispatcher implements Sc
.withId(schemaEntity.id())
.withName(schemaEntity.name())
.withNamespace(ident.namespace())
- .withComment(alteredSchema.comment())
- .withProperties(
- StringIdentifier.newPropertiesWithoutId(
- alteredSchema.properties()))
.withAuditInfo(
AuditInfo.builder()
.withCreator(schemaEntity.auditInfo().creator())
diff --git
a/core/src/test/java/org/apache/gravitino/catalog/TestSchemaOperationDispatcher.java
b/core/src/test/java/org/apache/gravitino/catalog/TestSchemaOperationDispatcher.java
index 3b52b3198d..f57a8c4038 100644
---
a/core/src/test/java/org/apache/gravitino/catalog/TestSchemaOperationDispatcher.java
+++
b/core/src/test/java/org/apache/gravitino/catalog/TestSchemaOperationDispatcher.java
@@ -278,53 +278,6 @@ public class TestSchemaOperationDispatcher extends
TestOperationDispatcher {
Assertions.assertEquals("test", alteredSchema1.auditInfo().lastModifier());
}
- @Test
- public void testAlterSchemaKeepsStoredCommentAndProperties() throws
IOException {
- NameIdentifier schemaIdent = NameIdentifier.of(metalake, catalog,
"schema_preserve_metadata");
- Map<String, String> props = ImmutableMap.of("k1", "v1", "k2", "v2");
- dispatcher.createSchema(schemaIdent, "comment", props);
-
- SchemaChange[] changes =
- new SchemaChange[] {
- SchemaChange.setProperty("k3", "v3"),
SchemaChange.removeProperty("k1")
- };
- dispatcher.alterSchema(schemaIdent, changes);
-
- SchemaEntity storedSchema = entityStore.get(schemaIdent, SCHEMA,
SchemaEntity.class);
- Assertions.assertEquals("comment", storedSchema.comment());
- Assertions.assertEquals(ImmutableMap.of("k2", "v2", "k3", "v3"),
storedSchema.properties());
- }
-
- @Test
- public void testAlterSchemaMultipleTimesKeepsMetadata() throws IOException {
- NameIdentifier schemaIdent = NameIdentifier.of(metalake, catalog,
"schema_multiple_alter");
- Map<String, String> props = ImmutableMap.of("k1", "v1", "k2", "v2");
- dispatcher.createSchema(schemaIdent, "initial comment", props);
-
- // First alteration: add a property
- SchemaChange[] changes1 = new SchemaChange[]
{SchemaChange.setProperty("k3", "v3")};
- dispatcher.alterSchema(schemaIdent, changes1);
-
- // Check metadata after first alteration
- SchemaEntity storedSchema1 = entityStore.get(schemaIdent, SCHEMA,
SchemaEntity.class);
- Assertions.assertEquals("initial comment", storedSchema1.comment());
- Assertions.assertEquals(
- ImmutableMap.of("k1", "v1", "k2", "v2", "k3", "v3"),
storedSchema1.properties());
-
- // Second alteration: remove a property and add a new one
- SchemaChange[] changes2 =
- new SchemaChange[] {
- SchemaChange.removeProperty("k1"), SchemaChange.setProperty("k4",
"v4")
- };
- dispatcher.alterSchema(schemaIdent, changes2);
-
- // Check metadata after second alteration
- SchemaEntity storedSchema2 = entityStore.get(schemaIdent, SCHEMA,
SchemaEntity.class);
- Assertions.assertEquals("initial comment", storedSchema2.comment());
- Assertions.assertEquals(
- ImmutableMap.of("k2", "v2", "k3", "v3", "k4", "v4"),
storedSchema2.properties());
- }
-
@Test
public void testCreateAndDropSchema() throws IOException {
NameIdentifier schemaIdent = NameIdentifier.of(metalake, catalog,
"schema31");