gokceni commented on a change in pull request #1170:
URL: https://github.com/apache/phoenix/pull/1170#discussion_r605926406
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
##########
@@ -2152,10 +2201,15 @@ public void createTable(RpcController controller,
CreateTableRequest request,
}
}
- private long getViewIndexSequenceValue(PhoenixConnection connection,
String tenantIdStr, PTable parentTable, PName physicalName) throws SQLException
{
+ private long getViewIndexSequenceValue(PhoenixConnection connection,
String tenantIdStr, PTable parentTable) throws SQLException {
int nSequenceSaltBuckets =
connection.getQueryServices().getSequenceSaltBuckets();
-
- SequenceKey key = MetaDataUtil.getViewIndexSequenceKey(tenantIdStr,
physicalName,
+ // parentTable is parent of the view index which is the view.
+ // Since parent is the view, the parentTable.getParentLogicalName()
returns the logical full name of the base table
+ PName parentName = parentTable.getParentLogicalName();
Review comment:
Basically if you change the physical name of a table, this function is
going to use the logical name instead of physical name of the base table. So
the sequence will not go back to the beginning. In the next pr, I will create a
view index, rename the table and create another view index to see that it is
not colliding. This should be enough right?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]