Skip to content

Commit 3296641

Browse files
authored
Re-introduce the ability to use -1 or NULL_TYPE to skip the type-check when doing lookupEntity (apache#43)
1 parent 4a6d032 commit 3296641

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TreeMapTransactionalPersistenceImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ public void deleteAllInCurrentTxn(@Nonnull PolarisCallContext callCtx) {
219219
@Nonnull PolarisCallContext callCtx, long catalogId, long entityId, int typeCode) {
220220
PolarisBaseEntity entity =
221221
this.store.getSliceEntities().read(this.store.buildKeyComposite(catalogId, entityId));
222-
if (entity != null && entity.getTypeCode() != typeCode) {
222+
if (entity != null
223+
&& typeCode != -1
224+
&& typeCode != PolarisEntityType.NULL_TYPE.getCode()
225+
&& entity.getTypeCode() != typeCode) {
223226
return null;
224227
}
225228
return entity;

0 commit comments

Comments
 (0)