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

[sqllogictest] Move decimal.rs tests #5086

Merged
merged 4 commits into from
Jan 28, 2023

Conversation

melgenek
Copy link
Contributor

Which issue does this PR close?

Part of #4495

Rationale for this change

Data-driven tests could be described in sqllogictest.

What changes are included in this PR?

Moves the tests that expect results from decimal.rs to sqllogictest.

Are these changes tested?

Github actions sqllogictest job.

Are there any user-facing changes?

No.

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jan 27, 2023
datafusion/core/tests/sql/decimal.rs Outdated Show resolved Hide resolved
datafusion/core/tests/sql/decimal.rs Outdated Show resolved Hide resolved
@melgenek melgenek marked this pull request as ready for review January 27, 2023 09:31
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @melgenek -- I reviewed all the tests and it seems like they were ported correctly

I left a comment about how to port the precision / type checking as well, but I think that could easily be done as a follow on PR as well

fyi @liukun4515

datafusion/core/tests/sql/decimal.rs Outdated Show resolved Hide resolved
datafusion/core/tests/sql/decimal.rs Outdated Show resolved Hide resolved
Comment on lines -373 to -375
// array decimal(10,6) + scalar decimal(20,0) => decimal(21,6)
assert_eq!(
&DataType::Decimal128(27, 6),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed that the comment expects a precision 21, but the assertion is 27. I am not sure if it's a typo in the comment, or if something is wrong with the type. I moved this test to decimal.slt as is.

Comment on lines +464 to +466
select arrow_typeof(abs(c1)) from decimal_simple limit 1;
----
Float64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original test didn't check the type of abs, but I added a test entry for it. It seems like a bug to me. Decimal(10,6) was converted to a Float64 as a result of abs call. It is probably related to #1335.

@melgenek
Copy link
Contributor Author

@alamb I updated this pr to include the type checks in sqllogictests using arrow_typeof. Please, take a look once more.

@melgenek melgenek requested a review from alamb January 27, 2023 23:58
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

This looks great -- thank you @melgenek

It is wonderful to see the momentum / cleanup going into the tests. I very much appreciate your efforts and I hope other members of the community will appreciate the development improvements that come from this work

@alamb alamb merged commit 69678d5 into apache:master Jan 28, 2023
@ursabot
Copy link

ursabot commented Jan 28, 2023

Benchmark runs are scheduled for baseline = 3da801d and contender = 69678d5. 69678d5 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-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants