Skip to content
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

[C++] Handle range of Decimal128 values that require 39 digits to be displayed #17752

Closed
asfimport opened this issue Oct 28, 2017 · 1 comment
Assignees
Milestone

Comments

@asfimport
Copy link

2 ** 127 - 1 and -2 ** 127 both require a 39th digit to be displayed as a decimal string.

This means we do not have the ability to display decimal values above 10 ** 38 - 1 even though we have the ability to store them.

For reference, Impala returns NULL when trying to cast 2 ** 127 - 1 to DECIMAL(38, 0).

A few next steps are in order:

  1. Explicitly test this behavior
  2. Avoid crashing or displaying garbage when we cannot display a number that can be stored
  3. Make a decision about whether we want to eventually support range of values from 10 ** 38 to 2 ** 127 - 1 positive and -2 ** 127 to -10 ** 38 negative. This would require a larger integer type to hold the value just before being converted to a string.

Reporter: Phillip Cloud / @cpcloud
Assignee: Phillip Cloud / @cpcloud

PRs and other links:

Note: This issue was originally created as ARROW-1749. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Issue resolved by pull request 1282
#1282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants