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

Cast from Decimal(p, s) to dictionary-encoded Decimal(p, s) loses precision and scale #6381

Closed
andygrove opened this issue Sep 11, 2024 · 2 comments · Fixed by #6383
Closed
Assignees
Labels
arrow Changes to the arrow crate bug

Comments

@andygrove
Copy link
Member

Describe the bug

I have code that calls cast_with_options to cast Decimal128(7, 2) to Dictionary<Int32, Decimal128(7,2)> but it actually produces Dictionary<Int32, Decimal128(38, 10)>.

I can see that this is because we ignore the precision and scale in the code in cast_to_dictionary:

        Decimal128(_, _) => {
            pack_numeric_to_dictionary::<K, Decimal128Type>(array, dict_value_type, cast_options)
        }

To Reproduce

Expected behavior

Additional context

@andygrove andygrove added the bug label Sep 11, 2024
@andygrove andygrove self-assigned this Sep 11, 2024
@andygrove
Copy link
Member Author

I plan on submitting a PR to fix this.

@alamb
Copy link
Contributor

alamb commented Oct 2, 2024

label_issue.py automatically added labels {'arrow'} from #6383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants