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

ramkrishna.s.vasudevan commented on PHOENIX-777:
------------------------------------------------

bq. for example, if you have a KeyValue column that is absent, a value of a 
primitive type will be null.
So this gets handled some where else? Ya that can be tweaked.  My point was to 
say that the primitives handling would change now is what I meant.
We discussed few points I think while retrieving the array if we use the 
primitive format of it then we will not be able to store null in them.  We 
should may be convert it to Primitive Object type array. 
bq.determine if we're the old format by dividing the number of bytes by the 
sizeof a single value. If it doesn't divide without a remainder, we've got the 
new format, otherwise we have the old format.
We thought something similar to this but as the number of elements were not 
there we decided it may be difficult. But as you say from the base type we can 
infer how much the length should occupy. Should be possible. 
bq.pad (if necessary) the array such that it doesn't divide evenly.
Add one byte as pad? Followed by the bitset.  
bq.don't store null values for any single byte primitive value. I think this is 
ok, as it doesn't make a whole lot of sense to have a TINYINT ARRAY in the 
first place (it's essentially the same as BINARY).
So this would apply for CHAR with 1 maxlength also?  Because for CHAR null is 
more meaningful right?


> Support null value for fixed length ARRAY
> -----------------------------------------
>
>                 Key: PHOENIX-777
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-777
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>            Assignee: Dumindu Buddhika
>
> A null value for a fixed length array can be handled with a bitset tacked on 
> the end of the array. If an element is set to null, then the bit at that 
> index is set. Trailing nulls are not stored and an attempt to access an array 
> past the current size returns null.
> Current behavior,
> PBinaryArray - Throws an exception when a null is inserted.
> PBooleanArray - null is considered as false when a null is inserted.
> PCharArray - Throws an exception when a null is inserted.
> PDateArray - Throws an exception when a null is inserted.
> PDoubleArray - null is considered as 0.0 when a null is inserted.
> PFloatArray - null is considered as 0.0 when a null is inserted.
> PIntegerArray - null is considered as 0 when a null is inserted.
> PLongArray - null is considered as 0 when a null is inserted.
> PSmallIntArray - null is considered as 0 when a null is inserted.
> PTimeArray - Throws an exception when a null is inserted.
> PTimeStampArray - Throws an exception when a null is inserted.
> PTinyIntArray - null is considered as 0 when a null is inserted.



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

Reply via email to