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

[REVIEW] Support building decimal columns with Table.TestBuilder [skip ci] #6770

Merged
merged 2 commits into from
Nov 18, 2020

Conversation

sperlingxx
Copy link
Contributor

This PR is about to support building decimal columns with Table.TestBuilder, which is widely used in automatic tests of spark-rapids plugin.

@sperlingxx sperlingxx requested a review from a team as a code owner November 14, 2020 08:58
@GPUtester
Copy link
Collaborator

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

@sperlingxx sperlingxx changed the title [REVIEW] Support building decimal columns with Table.TestBuilder [REVIEW] Support building decimal columns with Table.TestBuilder [skip ci] Nov 14, 2020
@codecov
Copy link

codecov bot commented Nov 14, 2020

Codecov Report

Merging #6770 (3d633c1) into branch-0.17 (01b8b5c) will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.17    #6770      +/-   ##
===============================================
+ Coverage        81.73%   81.77%   +0.04%     
===============================================
  Files               96       96              
  Lines            15981    15885      -96     
===============================================
- Hits             13062    12990      -72     
+ Misses            2919     2895      -24     
Impacted Files Coverage Δ
python/cudf/cudf/io/orc.py 81.13% <0.00%> (-1.45%) ⬇️
python/dask_cudf/dask_cudf/io/orc.py 90.90% <0.00%> (ø)
python/dask_cudf/dask_cudf/io/tests/test_orc.py 100.00% <0.00%> (ø)
python/dask_cudf/dask_cudf/core.py 74.01% <0.00%> (+0.32%) ⬆️
python/cudf/cudf/utils/ioutils.py 86.36% <0.00%> (+6.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01b8b5c...d71f78e. Read the comment docs.

@nartal1
Copy link
Member

nartal1 commented Nov 17, 2020

I went through this PR and it looks good to me. It would be great if we could get it reviewed from @revans2 as he had reviewed and had comments on this part (TestBuilder) in the earlier PR.

@jlowe jlowe added the Java Affects Java cuDF API. label Nov 17, 2020
Copy link
Contributor

@revans2 revans2 left a comment

Choose a reason for hiding this comment

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

Looks really good. Thanks for doing this.

int scale = type.getScale();
if (dataArray instanceof Integer[]) {
BigDecimal[] data = Arrays.stream(((Integer[]) dataArray))
.map((i) -> i == null ? null : BigDecimal.valueOf(i, -scale))
Copy link
Member

Choose a reason for hiding this comment

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

With unscaled values provided, why use BigDecimal instead of using the much cheaper unscaled value decimal constructors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because unscaled value constructors can not support null values, since it is for primitive values.

Copy link
Member

Choose a reason for hiding this comment

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

unscaled value constructors can not support null values

That seems like a problem with the value constructors that needs a followup. We support value constructors for Integer values that can accept null values, so why can't we do the same for unscaled decimal values? Having to go through BigDecimal to workaround a lack of functionality in the value constructor for decimals is not ideal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jlowe Yes. I created a new issue #6795 to follow this flaw.

Copy link
Member

@jlowe jlowe left a comment

Choose a reason for hiding this comment

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

Assuming an issue is filed to followup the lack of boxed unscaled decimal value construction, this looks OK to me.

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

Successfully merging this pull request may close these issues.

5 participants