Skip to content

feat: Implement decimal <-> float16 casts#10008

Open
neilconway wants to merge 1 commit into
apache:mainfrom
neilconway:neilc/feat-float-decimal-cast
Open

feat: Implement decimal <-> float16 casts#10008
neilconway wants to merge 1 commit into
apache:mainfrom
neilconway:neilc/feat-float-decimal-cast

Conversation

@neilconway
Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Arrow supports casts between decimal and float64/float32; for consistency and completeness, we should also support casts between decimal and float16.

In DataFusion, this will be particularly useful: once apache/datafusion#14612 is fixed, arrow_cast(0.0, 'Float16') will no longer work, unless we first add support for decimal -> float16 casts in arrow-rs.

What changes are included in this PR?

  • Add support for decimal -> float16 cast
  • Add support for float16 -> decimal cast
  • Add unit tests for new behavior
  • Update docs/comment on supported casts

Are these changes tested?

Yes; new tests added.

Are there any user-facing changes?

Yes; new casts are now supported. Otherwise no changes.

@github-actions github-actions Bot added the arrow Changes to the arrow crate label May 22, 2026
@neilconway
Copy link
Copy Markdown
Author

FYI @Jefffrey

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cast to/from decimal support for float16

2 participants