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

Gabriel Reid commented on PHOENIX-855:
--------------------------------------

Looking at the bigger issue here, allowing null in a primary key column at all 
seems very odd to me, considering that null != null, and the intention of a 
primary key is to *uniquely* identify rows.

Looking at the [Wikipedia page on unique 
keys|http://en.wikipedia.org/wiki/Unique_key], it says that the "correct" 
behaviour for something like this is that it should be possible to insert 
multiple rows using null as the primary key. Obviously, Wikipedia isn't the 
official reference on SQL, but this does sound correct to me.

As far as I can remember, I've always had to define a NOT NULL constraint on 
primary key columns in "traditional" SQL databases, so it makes sense to me to 
either explicitly require this on table creation in Phoenix, or implicitly 
include this constraint on primary key columns. 

> IsNullIT fails with HBase 0.98 and later
> ----------------------------------------
>
>                 Key: PHOENIX-855
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-855
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Gabriel Reid
>
> IsNullIT#testIsNullAsSingleKey is currently broken in master, giving an 
> IllegalArgumentException. The test in question checks the behavior of nulls 
> in a primary key.
> Phoenix uses an empty byte array as row key to represent a null for a primary 
> key, and this is explicitly disallowed in HBase as of HBASE-8101.



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

Reply via email to