[
https://issues.apache.org/jira/browse/PHOENIX-1038?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Taylor updated PHOENIX-1038:
----------------------------------
Attachment: PHOENIX-1038_v2.patch
The intent is not to generally support being able to add columns to the
SYSTEM.CATALOG (though that's possible to implement too), but rather to
automatically upgrade the table. We detect that it's "out-of-date" based on
it's timestamp. For 4.1, we have incremented the min system timestamp, so we'll
get a TableAlreadyExistsException instead of a NewerTableExistsException. We
upgrade the SYSTEM.CATALOG table by adding the new column at the incremented
min system timestamp. The next time around, when a client connects the
timestamp should be at the min system timestamp, so we should get a
NewerTableExistsException instead and the upgrade will be skipped.
To test this, you need to install the 4.1 snapshot jar on a cluster that has
already used 4.0. Then, once a client connects, check that the INDEX_TYPE
column was added to the SYSTEM.CATALOG.
> Dynamically add INDEX_TYPE column to SYSTEM.CATALOG if not already there
> ------------------------------------------------------------------------
>
> Key: PHOENIX-1038
> URL: https://issues.apache.org/jira/browse/PHOENIX-1038
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: rajeshbabu
> Assignee: James Taylor
> Fix For: 5.0.0, 4.1
>
> Attachments: PHOENIX-1038.patch, PHOENIX-1038_v2.patch,
> PHOENIX-933.patch, addColumnsToSystemTable.patch
>
>
> When a query involves more columns to project than columns in index and query
> condition involves leading columns in local index then first we can get
> matching rowkeys from local index table and then get the required columns
> from data table. In local index both data region and index region co-reside
> in the same RS, we can call get on data region to get the missing columns in
> the index, without any n/w overhead. So it's efficient.
--
This message was sent by Atlassian JIRA
(v6.2#6252)