accumulo icon indicating copy to clipboard operation
accumulo copied to clipboard

Provide Lexicoder for decimal data

Open DomGarguilo opened this issue 4 years ago • 5 comments

Original Jira ticket: https://issues.apache.org/jira/browse/ACCUMULO-4628

The ticket suggests adding a lexicoder for BigDecimal.

The original ticket does not detail why this might be needed or what a lexicoder is used for. I wanted to re-create this ticket to see if there was any interest for this feature or insight into how it might be useful.

DomGarguilo avatar Aug 05 '21 20:08 DomGarguilo

BigDecimal seems tricky. You may need to normalize them in order to store them somehow. You can do some normalization by stripping trailing zero digits, but you still have to store the original precision in order to restore it on deserialization, and it has to be part of the ordering (example: 2.0 is not the same as 2.00, so we'd also have to decide which to sort first, the more precise or less precise values). After stripping trailing zero digits, you are still left with an unscaled integer that you need to normalize somehow if you want to do something like store the exponent first in order to order by magnitude, similar to how we store Double values. It gets further complicated that the unscaled integer is actually a BigInteger, so you'd have to store that part similar to our BigIntegerLexicoder. And then, after that, you still have to store the original scale, so we can order two equivalent numerical values lastly by precision. And, you have to deal with negative values too.

I haven't seen too much pressure to implement this. Given the complexity of implementing, I probably wouldn't prioritize this. Hopefully most users will be happy with more limited precision Double values or BigInteger.

ctubbsii avatar Aug 05 '21 23:08 ctubbsii

I probably wouldn't prioritize this.

Yea, I'll leave it for now and see if there is any interest eventually.

DomGarguilo avatar Aug 06 '21 15:08 DomGarguilo

I can work on this if needed.

harjitdotsingh avatar Sep 01 '21 17:09 harjitdotsingh

@harjitdotsingh You're welcome to it, if you wish. I wouldn't characterize it as "needed", though I can't speak for all users. If it interests you, feel free to pursue it. We can assign it to you, so others know you're pursuing it and can coordinate with you if they also have an interest. Would you want us to assign it to you?

ctubbsii avatar Sep 21 '21 02:09 ctubbsii

Yes Please.

Thanks

  • Harjit

On Mon, Sep 20, 2021 at 10:41 PM Christopher Tubbs @.***> wrote:

@harjitdotsingh https://github.com/harjitdotsingh You're welcome to it, if you wish. I wouldn't characterize it as "needed", though I can't speak for all users. If it interests you, feel free to pursue it. We can assign it to you, so others know you're pursuing it and can coordinate with you if they also have an interest. Would you want us to assign it to you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/accumulo/issues/2226#issuecomment-923560171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASJ7QOU3G6FQ6TSIIFXELUC7WGBANCNFSM5BUTDG6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

harjitdotsingh avatar Sep 21 '21 04:09 harjitdotsingh

Closing this due to lack of interest/need. See discussion on PR #2535

ctubbsii avatar Nov 16 '22 07:11 ctubbsii