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

Tests showing user defined aggregate returning a struct #3425

Merged
merged 1 commit into from
Sep 11, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Sep 9, 2022

Which issue does this PR close?

Closes #600

Rationale for this change

It turns out that DataFusion supports user defined aggregates returning a struct but there is very little end to end SQL testing of the feature

Adding end to end testing will ensure that the feature doesn't get broken accidentally any maybe provides an example for others to start from when working on their own features

What changes are included in this PR?

Add a new "rust integration test" showing a user defined aggregate returning a struct. It can be run like

cargo test -p datafusion --test user_defined_aggregates

Are there any user-facing changes?

No

@@ -108,12 +108,12 @@ pub mod window;

pub mod arrow_typeof;
pub mod decimal;
mod explain;
mod idenfifers;
pub mod explain;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a driveby cleanup to make module definitions in sql/mod.rs consistent


#[tokio::test]
/// Basic query for with a udaf returning a structure
async fn test_udf_returning_struct() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is actually quite cool that this works 👌

@codecov-commenter
Copy link

Codecov Report

Merging #3425 (8c19bb0) into master (8b59b20) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3425      +/-   ##
==========================================
+ Coverage   85.64%   85.66%   +0.02%     
==========================================
  Files         296      297       +1     
  Lines       54464    54538      +74     
==========================================
+ Hits        46643    46719      +76     
+ Misses       7821     7819       -2     
Impacted Files Coverage Δ
datafusion/core/tests/sql/mod.rs 97.77% <ø> (ø)
datafusion/core/tests/user_defined_aggregates.rs 100.00% <100.00%> (ø)
datafusion/expr/src/logical_plan/plan.rs 77.19% <0.00%> (-0.17%) ⬇️
datafusion/core/src/physical_plan/planner.rs 77.15% <0.00%> (+0.28%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yjshen yjshen merged commit 5af707b into apache:master Sep 11, 2022
@ursabot
Copy link

ursabot commented Sep 11, 2022

Benchmark runs are scheduled for baseline = 4d22076 and contender = 5af707b. 5af707b 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/struct_tests branch August 8, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow User Defined Aggregates to return multiple values / structs
5 participants