You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2014/05/27 02:41:02 UTC

[jira] [Commented] (PHOENIX-1004) 'drop index' should delete index data from local index table

    [ https://issues.apache.org/jira/browse/PHOENIX-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14009181#comment-14009181 ] 

James Taylor commented on PHOENIX-1004:
---------------------------------------

This code should not be necessary, as MetaDataClient.dropIndex() calls dropTable() which in turn makes the following call (line 1414):
{code}
                            MutationPlan plan = new PostDDLCompiler(connection).compile(tableRefs, null, null, Collections.<PColumn>emptyList(), ts);
                            return connection.getQueryServices().updateData(plan);
{code}
I suspect the problem is that the boolean dropMetaData is true, but in this case (for indexes on views and local indexes), we want it to be false. In that case, it should do the right thing.
Try just changing line 1383 like this (and moving it into the if statement after the declaration of the table local variable):
{code}
                    boolean dropMetaData = table.getViewIndexId() == null && connection.getQueryServices().getProps().getBoolean(DROP_METADATA_ATTRIB, DEFAULT_DROP_METADATA);
{code}


> 'drop index' should delete index data from local index table
> ------------------------------------------------------------
>
>                 Key: PHOENIX-1004
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1004
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: rajeshbabu
>            Assignee: rajeshbabu
>         Attachments: PHOENIX-1004.patch
>
>
> When we drop local index then automatically index data should be deleted from local index table.
> Currently delete index data not supported even for view index drop.
> Same fix helps in both the cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)