[ https://issues.apache.org/jira/browse/PHOENIX-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14543912#comment-14543912 ]
James Taylor commented on PHOENIX-777: -------------------------------------- [~ram_krish] - that code can be tweaked as necessary. We just don't have a way of *serializing* a null value. We do allow it to be null, though - for example, if you have a KeyValue column that is absent, a value of a primitive type will be null. The bigger issue is the one that [~Dumindux] brings up with b/w compatibility. I don't think that scheme is going to work, as we can't differentiate between a value and the version byte. The only feasible way I can think to do it is: - 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. - pad (if necessary) the array such that it doesn't divide evenly. - 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). > 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)