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

jay wong commented on PHOENIX-923:
----------------------------------

[~jamestaylor]

I found when create table, It only check single pk column defined as NULL,
but when multi  pk columns,  all PK can be defined as NULL.

In my opinion. all pk must be defined as NOT NULL.

So I want to know why allow pk column define as NULL

> when I create table, the column without assign any  column family. the NOT 
> NULL keywords   is not take effect
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-923
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-923
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: jay wong
>             Fix For: 3.0.0
>
>         Attachments: PHOENIX-923.patch, PHOENIX-923v2.patch
>
>
> eg:
>  create table if not exists table_test
>   varchar_pk VARCHAR NOT NULL, 
>   char_pk CHAR(5) NOT NULL, 
>   int_column INTEGER NOT NULL, 
>   int_column_b INTEGER NOT NULL
>   CONSTRAINT pk PRIMARY KEY (varchar_pk, char_pk);
> the create ddl sql is all right execute well.
> but if I upsert a record without int_column and int_column_b, it is also be 
> insert. so the NOT NULL isn't  take effect
> Also create ddl sql is:
>  create table if not exists table_test
>   varchar_pk VARCHAR NOT NULL, 
>   char_pk CHAR(5) NOT NULL, 
>   A.int_column INTEGER NOT NULL, 
>   A.int_column_b INTEGER NOT NULL
>   CONSTRAINT pk PRIMARY KEY (varchar_pk, char_pk);
> it throw:
> java.sql.SQLException: ERROR 1007 (42K01): A key/value column may not be 
> declared as not null. columnName=A.INT_COLUMN
> so Why  assign any  column family and not assign the worked difference? 
> I found MetaDataClient#newColumn logic is tricky.
> the code just want system table didn't check not null, so the default column 
> family name not check. but user table is also can use default column family.
> so I do some adjust for the code here
>  



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

Reply via email to