Skip to content

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Mar 13, 2023

Which issue does this PR close?

Part of #4495

Follow on to #5434

Rationale for this change

I am trying to keep the testability of DataFusion reasonable. Sqllogictests are easier to add / update so we are trying to move stuff over there.

What changes are included in this PR?

Port more aggregate tests to aggregate.slt

Are these changes tested?

Yes all tests

Are there any user-facing changes?

No

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Mar 13, 2023
statement ok
create table t as
select
arrow_cast(column1, 'Timestamp(Nanosecond, None)') as nanos,
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 added arrow_cast in #5166 to help port this kind of test (to control the arrow types explicitly)

2021-01-01T05:11:10.432 2021-01-01T05:11:10.432 2021-01-01T05:11:10.432 2021-01-01T05:11:10 Row 3


# aggregate_timestamps_sum() -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the part with function signature is excessive here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed -- removed in 9f59a70

statement error DataFusion error: Error during planning: The function Sum does not support inputs of type Time64\(Nanosecond\).
SELECT sum(nanos), sum(micros), sum(millis), sum(secs) FROM t

# aggregate_times_count() -> Result<()>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here regarding function signature.

21:06:28.247821084 21:06:28.247821 21:06:28.247 21:06:28


# aggregate_times_avg
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

statement error Error during planning: The function Sum does not support inputs of type Timestamp\(Nanosecond, None\)
SELECT sum(nanos), sum(micros), sum(millis), sum(secs) FROM t;

query IIII
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's wort adding test name for this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea -- added in 5f77bb0

@korowa
Copy link
Contributor

korowa commented Mar 13, 2023

Thanks @alamb!

Looks great overall. I've only left couple of comments regarding typos (I guess) -- they don't affect logs readability, but still.

@alamb alamb merged commit e6d7106 into apache:main Mar 14, 2023
@ursabot
Copy link

ursabot commented Mar 14, 2023

Benchmark runs are scheduled for baseline = 35a3acf and contender = e6d7106. e6d7106 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

@alamb alamb deleted the alamb/port_more_aggregates branch October 18, 2024 20:46
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.

4 participants