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

Daniel Wong commented on PHOENIX-4717:
--------------------------------------

The document we were working on is a start of this type of work for sure though 
I hope for it to be broader in topic and discuss PK layout in all situations. 
[~swaroopa] and I have a beginning of a document for this but its still in 
draft.  FYI [~tdsilva]

> Document restrictions on adding primary key columns
> ---------------------------------------------------
>
>                 Key: PHOENIX-4717
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4717
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: Thomas D'Silva
>            Priority: Major
>
> For both views and tables
> 1. We allow nullable columns in the PK, but only if they're variable length. 
> Variable length types may be null, since we use a null-byte terminator (which 
> is a disallowed character in variable length types). Fixed width types do not 
> have a way of representing null.
> There is the following TODO in PColumnImpl.init 
> // TODO: we may be able to allow this for columns at the end of the PK
> 2. We disallow adding a column to the PK 
>    a) if the last PK column is VARBINARY 
>    b) if the last PK column is fixed width and nullable //not sure if this is 
> possible currently because of #1
>    c) if the column is not nullable (in order to handle existing rows)
> For views:
> 1. We disallow adding a column to the PK If the last pk column is variable 
> length
> If the last pk column is variable length then we read all the bytes of the 
> rowkey without looking for a separator byte so we cannot add a pk column to a 
> view if the last pk column of the parent is variable length (see 
> https://issues.apache.org/jira/browse/PHOENIX-978?focusedCommentId=14617847&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14617847)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to