-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ArrayIndexOutOfBoundsException in primary key index #400
base: master
Are you sure you want to change the base?
Conversation
ghost
commented
Feb 22, 2019
- reproduce long-typed primary key with a value of 0 cannot be accessed depending on the complexity of other long primary keys #399
- determine root cause and fix
Unit test that reproduces #399
The issue is not with the primary key index but with what is considered an absent value (referred to as a null value). Even for values (not references) such as the value of a When writing out state the maximum number of bits required to encode a field is computed and encoded, which is the maximum of the number of bits to encode each value. More specifically for an integral value (such as a In summary, the maximum number of bits of an integral value is the result of the expression The absent integral value is chosen to be The problem encountered is that the maximum number of bits for the The result of
It is assumed the primary key index ignores absent values, hence the object for an id of I don't yet know what can be done about this. My advice for now would be to restrict long values to a maximum of 62 bits. |
Thanks for the detailed explanation, @PaulSandoz! When you say:
Do you mean, restrict long values to a maximum of 62 bits if lookup with 0 indexed key is necessary? Or restrict long values to a maximum of 62 bits full stop? If I understand the explanation, it sounds like 0 should be the only problematic value. Am I missing something? |
@jkade yes, you can avoid a |