Skip to content

Commit 45f5777

Browse files
committed
PHOENIX-7955: Return earlier
1 parent b03e5b7 commit 45f5777

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,11 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName,
19921992
}
19931993
return null;
19941994
} else {
1995+
if (createIfNotExists && doesPhoenixTableAlreadyExist(existingDesc)) {
1996+
// Already a Phoenix-managed table, skip remaining modifications entirely.
1997+
return existingDesc;
1998+
}
1999+
// We create phoenix table that maps to existing HBase table - we shall continue to add coprocessors.
19952000
if (isMetaTable && !isUpgradeRequired()) {
19962001
checkClientServerCompatibility(
19972002
SchemaUtil.getPhysicalName(SYSTEM_CATALOG_NAME_BYTES, this.getProps()).getName());
@@ -2053,8 +2058,8 @@ private TableDescriptor ensureTableCreated(byte[] physicalTableName,
20532058
return null; // Indicate that no metadata was changed
20542059
}
20552060

2056-
// Do not call modifyTable for: SYSTEM tables or when CREATE IF NOT EXISTS was used.
2057-
if (tableType != PTableType.SYSTEM && !createIfNotExists) {
2061+
// Do not call modifyTable for SYSTEM tables
2062+
if (tableType != PTableType.SYSTEM) {
20582063
modifyTable(physicalTableName, newDesc.build(), true);
20592064
}
20602065
return result;

0 commit comments

Comments
 (0)