[
https://issues.apache.org/jira/browse/PHOENIX-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16299427#comment-16299427
]
James Taylor commented on PHOENIX-4382:
---------------------------------------
Thanks for the explanation. Couple of follow up questions/comments:
- Any issues with TINYINT or BYTE(1)? Does your new code handle that correctly?
- If there are multiple null values, do we have more ambiguous cases?
- BYTE(2) would potentially have the same issue as SMALLINT, right?
- Variable length types won’t use the separator byte, so I think we’re ok there.
- For unsigned small int, we’d know that {ascSeparatorByte, 1} is null since
it’s not a valid value, but it’s not worth passing all the type info around
just for this one case.
- Would this be an accurate subject: Two byte fixed length values may be
incorrectly interpreted as null for SINGLE_CELL_ARRAY_WITH_OFFSETS encoding?
> Immutable table SINGLE_CELL_ARRAY_WITH_OFFSETS values starting with separator
> byte return null in query results
> ---------------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-4382
> URL: https://issues.apache.org/jira/browse/PHOENIX-4382
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.14.0
> Reporter: Vincent Poon
> Assignee: Vincent Poon
> Attachments: PHOENIX-4382.v1.master.patch,
> PHOENIX-4382.v2.master.patch, UpsertBigValuesIT.java
>
>
> For immutable tables, upsert of some values like Short.MAX_VALUE results in a
> null value in query resultsets. Mutable tables are not affected. I tried
> with BigInt and got the same problem.
> For Short, the breaking point seems to be 32512.
> This is happening because of the way we serialize nulls. For nulls, we write
> out [separatorByte, #_of_nulls]. However, some data values, like
> Short.MAX_VALUE, start with separatorByte, we can't distinguish between a
> null and these values. Currently the code assumes it's a null when it sees a
> leading separatorByte, hence the incorrect query results.
> See attached test - testShort() , testBigInt()
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)