phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-3547) Promote CATALOG.VIEW_INDEX_ID to an int
Date Fri, 16 Mar 2018 17:00:00 GMT


James Taylor commented on PHOENIX-3547:

You'd need to dip under the covers and run an UPSERT VALUES directly on the SYSTEM.CATALOG
table to make this change since we don't support it in an ALTER TABLE call. You'd also need
to (at upgrade time in ConnectionQueryServicesImpl.init()) write the rewrite the value for
all existing rows. An alternative would be to detect at read time if the column value is only
two bytes and read it as a short in that case in MetaDataEndPointImpl.getTable():
        Cell viewIndexIdKv = tableKeyValues[VIEW_INDEX_ID_INDEX];
        Short viewIndexId = viewIndexIdKv == null ? null : (Short)MetaDataUtil.getViewIndexIdDataType().getCodec().decodeShort(viewIndexIdKv.getValueArray(),
viewIndexIdKv.getValueOffset(), SortOrder.getDefault());
As far as I can tell, it looks like VIEW_INDEX_ID is only read here and used during the construction
of the PTable (object representation of the table metadata). 

> Promote CATALOG.VIEW_INDEX_ID to an int
> ---------------------------------------
>                 Key: PHOENIX-3547
>                 URL:
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: Jeremy Huffman
>            Priority: Minor
> Increase the size of CATALOG.VIEW_INDEX_ID from smallint to int to support a large number
of indexed views on a single table.
> Per James: "The code would just need to be tolerant when reading the data if the length
is two byte short versus four byte int. At write time, we'd just always write an int."
> See:

This message was sent by Atlassian JIRA

View raw message