Skip to content

Conversation

@thisisnic
Copy link
Member

@thisisnic thisisnic commented Jun 5, 2025

Rationale for this change

32 and 64 bit Decimal types were added in C++ in #43957 but haven't been implemented in R yet

What changes are included in this PR?

Implements them in R

Are these changes tested?

Yup

Are there any user-facing changes?

Yeah, new types but also the implicit downcasting so we should think about how to communicate this if at all

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I split the text up in this vignette to make it easier to edit and track edits in future, but the only actual changes I made were to this line, where I added the new decimal types in.

@thisisnic thisisnic force-pushed the GH-46719_add_decimal_32_64 branch from 447c3d4 to fc5ab6b Compare June 13, 2025 15:28
@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting committer review Awaiting committer review awaiting changes Awaiting changes labels Jun 13, 2025
@thisisnic thisisnic marked this pull request as ready for review June 13, 2025 15:29
@thisisnic thisisnic requested a review from jonkeane as a code owner June 13, 2025 15:29
@thisisnic thisisnic requested a review from amoeba June 13, 2025 15:30
r/R/enums.R Outdated
Comment on lines +84 to +87
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were we just missing these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, went and looked the decimal ones up in the C++ and found a few more missing too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little surprised there weren't / aren't tests that caught this? But maybe I don't totally grok what's up with these

Copy link
Member Author

@thisisnic thisisnic Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know what these enums do, haven't traced it through, but my guess would be that they don't matter as we haven't implemented them in R? Hmm, in which case, maybe I remove? (Can do in a follow-up)

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jun 13, 2025
Comment on lines -500 to -503
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this cleanup, though am I misunderstanding that #30667 is still open? Or maybe this was actually implemented somewhere and we should close that issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I confused the JIRA and GitHub numbers. Will double check the C++ code to double check though.

Copy link
Member Author

@thisisnic thisisnic Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were tests added here so we can get rid of our own tests for this, but the decimal() C++ function was deprecated in favour of smallest_decimal() so I'll need to swap that out too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, we don't actually use the C++ decimal() function anyway, so no changes needed. We could look to use smallest_decimal() instead of working out which decimal it should be ourselves in the R code, but I don't think the time it would take to make this change would be worth the effort, though can open a new ticket if you disagree.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would mean being able to delete some code in the R package, which is nice — let's make an issue but agreed we don't need to tackle it here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - #46825

Copy link
Member

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Generally looks good, though have a few comments / questions

@thisisnic thisisnic force-pushed the GH-46719_add_decimal_32_64 branch from fc5ab6b to 1a6dff6 Compare June 16, 2025 10:54
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jun 16, 2025
@thisisnic
Copy link
Member Author

Cheers for the review @jonkeane. I've rebased to see if that fixes the linter error, but will run locally anyway to make sure. Any other changes to make before we merge?

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jun 16, 2025
Copy link
Member

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

r/R/enums.R Outdated
Comment on lines +84 to +87
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little surprised there weren't / aren't tests that caught this? But maybe I don't totally grok what's up with these

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Jun 16, 2025
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Jun 16, 2025
@thisisnic thisisnic merged commit 202787f into apache:main Jun 16, 2025
40 of 41 checks passed
@thisisnic thisisnic removed the awaiting changes Awaiting changes label Jun 16, 2025
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 202787f.

There were 115 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

alinaliBQ pushed a commit to Bit-Quill/arrow that referenced this pull request Jun 17, 2025
### Rationale for this change

32 and 64 bit Decimal types were added in C++ in apache#43957 but haven't been implemented in R yet

### What changes are included in this PR?

Implements them in R

### Are these changes tested?

Yup

### Are there any user-facing changes?

Yeah, new types but also the implicit downcasting so we should think about how to communicate this if at all

* GitHub Issue: apache#46719

Authored-by: Nic Crane <[email protected]>
Signed-off-by: Nic Crane <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants