[
https://issues.apache.org/jira/browse/PHOENIX-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16644292#comment-16644292
]
ASF GitHub Bot commented on PHOENIX-4764:
-----------------------------------------
Github user BinShi-SecularBird commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/359#discussion_r223906186
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
---
@@ -2655,10 +2666,19 @@ private MetaDataMutationResult doDropTable(byte[]
key, byte[] tenantId, byte[] s
boolean hasChildViews =
ViewFinder.hasChildViews(hTable, tenantId,
schemaName, tableName,
clientTimeStamp);
- if (hasChildViews && !isCascade) {
- // DROP without CASCADE on tables with child views
is not permitted
- return new
MetaDataMutationResult(MutationCode.UNALLOWED_TABLE_MUTATION,
-
EnvironmentEdgeManager.currentTimeMillis(), null);
+ if (hasChildViews) {
+ if (!isCascade) {
+ // DROP without CASCADE on tables with child
views is not permitted
--- End diff --
Why do we have this limitation? Shouldn't DROP mean "DROP CASCADE" in the
case that the table has child views? This comment is orthogonal to this pull
request as it exists in the original code base.
> Cleanup metadata of child views for a base table that has been dropped
> ----------------------------------------------------------------------
>
> Key: PHOENIX-4764
> URL: https://issues.apache.org/jira/browse/PHOENIX-4764
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Thomas D'Silva
> Assignee: Kadir OZDEMIR
> Priority: Major
>
> When we drop a base table, we no longer drop all the child view metadata.
> Clean up the child view metadata during compaction.
> If we try to recreate a base table that was previously dropped but whose
> child view metadata wasn't cleaned up throw an exception. Add a test for
> this.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)