Skip to content

Commit 8664692

Browse files
committed
fix a mistake
1 parent ab1997e commit 8664692

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/src/main/java/org/apache/gravitino/catalog/TableOperationDispatcher.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,12 @@ public Table alterTable(NameIdentifier ident, TableChange... changes)
203203
// write on the new table name, or use the read lock on the table instead.
204204
boolean containsRenameTable =
205205
Arrays.stream(changes).anyMatch(c -> c instanceof TableChange.RenameTable);
206-
LockType lockType = containsRenameTable ? LockType.WRITE : LockType.READ;
206+
NameIdentifier nameIdentifierForLock =
207+
containsRenameTable ? NameIdentifier.of(ident.namespace().levels()) : ident;
207208

208209
return TreeLockUtils.doWithTreeLock(
209-
NameIdentifier.of(ident.namespace().levels()),
210-
lockType,
210+
nameIdentifierForLock,
211+
LockType.WRITE,
211212
() -> {
212213
NameIdentifier catalogIdent = getCatalogIdentifier(ident);
213214
Table alteredTable =

0 commit comments

Comments
 (0)