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

Samarth Jain commented on PHOENIX-1641:
---------------------------------------

Here is the history:

INDEX_TYPE column was added for local indexes -> MIN_SYSTEM_TABLE_TIMESTAMP = 
MIN_TABLE_TIMESTAMP + 2
Commit : 
https://github.com/apache/phoenix/commit/9a5529c8a02f035fa81db3b7b2a4f0304bf59c1d

Columns added for additional arguments in CREATE SEQUENCE -> 
MIN_SYSTEM_TABLE_TIMESTAMP = MIN_TABLE_TIMESTAMP + 3
Commit : 
https://github.com/apache/phoenix/commit/aba5ea906424238664ef61dbb04e39de5896cc43

SEQUENCE table was salted -> MIN_SYSTEM_TABLE_TIMESTAMP = MIN_TABLE_TIMESTAMP + 
4
Commit: 
https://github.com/apache/phoenix/commit/7e063d63d7cb29cb01e790f49d1ff42ddb042980

SEQUENCE table wasn't pre-splitting ->  MIN_SYSTEM_TABLE_TIMESTAMP = 
MIN_TABLE_TIMESTAMP + 5
Commit: 
https://github.com/apache/phoenix/commit/cb60cb4a3b0181df841fef10c0365e197d96b59d

STORE_NULLS column was added -> MIN_SYSTEM_TABLE_TIMESTAMP = 
MIN_TABLE_TIMESTAMP + 6
Commit: 
https://github.com/apache/phoenix/commit/2babb546484e983e6b1b029b9909651d241678cb

Looks like when INDEX_DISABLE_TIMESTAMP column was added as part of 
https://issues.apache.org/jira/browse/PHOENIX-950, the timestamp wasn't 
updated. 
Commit: 
https://github.com/apache/phoenix/commit/3d69fa21123d182577a58bbc517d40ea9dc5a2cd

The column was added *after* MIN_SYSTEM_TABLE_TIMESTAMP = MIN_TABLE_TIMESTAMP + 
2 and *before*  MIN_SYSTEM_TABLE_TIMESTAMP = MIN_TABLE_TIMESTAMP + 3

Considering this, is the following ok? 

{code}
String columnsToAdd = PhoenixDatabaseMetaData.STORE_NULLS + " " + 
PBoolean.INSTANCE.getSqlTypeName();
                                if (currentTimestamp < MIN_TABLE_TIMESTAMP + 2) 
{
                                     columnsToAdd += ", " + 
PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP + " " + 
PLong.INSTANCE.getSqlTypeName() + ", " + PhoenixDatabaseMetaData.INDEX_TYPE + " 
" + PUnsignedTinyint.INSTANCE.getSqlTypeName();
                                }
{code}
 

> Add back the upgrade code in ConnectionQueryServicesImpl
> --------------------------------------------------------
>
>                 Key: PHOENIX-1641
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1641
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>             Fix For: 5.0.0, 4.3
>
>         Attachments: PHOENIX-1641.patch
>
>
> The code got removed in the commit: 
> https://github.com/apache/phoenix/commit/58c80a1857659962d695bc8e5fe22b4e401b7f0a
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to