virajjasani commented on code in PR #1534:
URL: https://github.com/apache/phoenix/pull/1534#discussion_r1047659070


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -4373,10 +4380,39 @@ private PhoenixConnection upgradeSystemSequence(
             } else {
                 nSequenceSaltBuckets = getSaltBuckets(e);
             }
+
+            updateSystemSequenceWithCacheOnWriteProps(metaConnection);
         }
         return metaConnection;
     }
 
+    private void updateSystemSequenceWithCacheOnWriteProps(PhoenixConnection 
metaConnection) throws
+        IOException, SQLException {
+
+        try (Admin admin = getAdmin()) {
+            PTable pTable = PhoenixRuntime.getTable(metaConnection,
+                PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME);
+            TableDescriptor oldTD = admin.getDescriptor(
+                
SchemaUtil.getPhysicalTableName(PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME,
+                    metaConnection.getQueryServices().getProps()));
+            ColumnFamilyDescriptor oldCf = oldTD.getColumnFamily(
+                SchemaUtil.getEmptyColumnFamily(pTable));

Review Comment:
   Since this table is one of the System tables, we can directly use 
`DEFAULT_COLUMN_FAMILY_BYTES` instead of calling 
`SchemaUtil#getEmptyColumnFamily`. Moreover, this would also help getting rid 
of calling `PhoenixRuntime#getTable`.
   
   ```
               TableDescriptor oldTD = admin.getDescriptor(
                   
SchemaUtil.getPhysicalTableName(PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME,
                       metaConnection.getQueryServices().getProps()));
               ColumnFamilyDescriptor oldCf = 
oldTD.getColumnFamily(QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES);
   ```



-- 
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]

Reply via email to