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

Make DecimalArray as PrimitiveArray #2857

Merged
merged 6 commits into from Oct 13, 2022

Conversation

viirya
Copy link
Member

@viirya viirya commented Oct 11, 2022

Which issue does this PR close?

Part of #2637.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@viirya viirya marked this pull request as draft October 11, 2022 08:18
@github-actions github-actions bot added arrow Changes to the arrow crate parquet Changes to the parquet crate labels Oct 11, 2022
@viirya viirya force-pushed the decimal_primitive_array branch 6 times, most recently from adeca0e to de451bb Compare October 11, 2022 20:00
@viirya viirya marked this pull request as ready for review October 11, 2022 21:13
@viirya
Copy link
Member Author

viirya commented Oct 11, 2022

Hopefully to move this forward.

cc @sunchao @tustvold

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

Thank you for this, just got off a 26 hour flight so will review this more thoroughly once my brain is functioning again properly. Only major comment is regards to validation, which I think can be relaxed

/// # Safety
///
/// This doesn't validate decimal values with specified precision.
pub unsafe fn unchecked_with_precision_and_scale(
Copy link
Contributor

Choose a reason for hiding this comment

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

The move to PrimitiveArray implicitly means away from validating the contents for overflow, as any value of the underlying primitive is permitted.

I think we should therefore make this safe, and remove any value validation except for when this method is explicitly called by the user, as an opt-in

@viirya
Copy link
Member Author

viirya commented Oct 12, 2022

These clippy errors are not from this change but due to recent change on invalid_html_tags, fixing it at #2862.

@alamb
Copy link
Contributor

alamb commented Oct 12, 2022

cc @liukun4515

@alamb
Copy link
Contributor

alamb commented Oct 12, 2022

If / when this PR is ready to merge, I would like to try to update DataFusion to use it (to understand what kind of changes will be needed in downstream crates). Please let me know @viirya and @tustvold

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

I think this is a good improvement and brings us closer to the vision of #2857. I think we should get this in, to start the process of updating the dependencies (something I fully intend to help out with), and continue to refine this in subsequent PRs.

I've taken the liberty of resolving the merge conflicts

@viirya
Copy link
Member Author

viirya commented Oct 13, 2022

Thanks @tustvold @alamb

@tustvold tustvold merged commit eeb1261 into apache:master Oct 13, 2022
@ursabot
Copy link

ursabot commented Oct 13, 2022

Benchmark runs are scheduled for baseline = fa1d079 and contender = eeb1261. eeb1261 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@alamb alamb added the api-change Changes to the arrow API label Oct 14, 2022
@tustvold
Copy link
Contributor

DataFusion upgrade PR - apache/datafusion#3844

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

Successfully merging this pull request may close these issues.

None yet

4 participants