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

Minor: port some explain test to sqllogictest, add filename normalization #5252

Merged
merged 5 commits into from
Feb 12, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Feb 11, 2023

Which issue does this PR close?

Part of #4495

Rationale for this change

As part of porting window functions tests in #5199 I found there was additional work to do for normalizing explain plans.

What changes are included in this PR?

  1. This PR ports an explain test to sqllogictest and updates the display normalization to handle it

Are these changes tested?

Yes

Are there any user-facing changes?

No

@alamb alamb added the development-process Related to development process of DataFusion label Feb 11, 2023
@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) and removed development-process Related to development process of DataFusion labels Feb 11, 2023
/// " Projection: d.b, MAX(d.a) AS max_a",
/// ]
/// ```
fn expand_row(mut row: Vec<String>) -> impl Iterator<Item = Vec<String>> {
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 was needed otherwise sqllogictest got confused about cells that had multiple rows in them

LOCATION '../../testing/data/csv/aggregate_test_100.csv';

query CC
explain SELECT c1 FROM aggregate_test_100 where c2 > 10
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is an explain test in sqllogictest output!

@@ -673,42 +673,6 @@ async fn test_physical_plan_display_indent_multi_children() {
);
}

#[tokio::test]
#[cfg_attr(tarpaulin, ignore)]
async fn csv_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 test is ported to the sqllogictest framework as an example

]];
assert_eq!(expected, actual);

let sql = "explain SELECT c1 FROM aggregate_test_100 where c2 > 10";
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 second test was to show that the explicit casting was removed but I don't think that is needed anymore with the improved coverage of casting as well as the (about to be) better plan test coverage

@alamb
Copy link
Contributor Author

alamb commented Feb 11, 2023

FYI @xudong963 and @melgenek

@xudong963 xudong963 self-requested a review February 11, 2023 13:56
datafusion/core/tests/sqllogictests/README.md Outdated Show resolved Hide resolved
Co-authored-by: Yevhenii Melnyk <melnyk.yevhenii@gmail.com>
WITH HEADER ROW
LOCATION '../../testing/data/csv/aggregate_test_100.csv';

query ??
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if query ? works?

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 was added by --complete mode, so I believe it does)

@xudong963 xudong963 merged commit 50f6e69 into apache:master Feb 12, 2023
@ursabot
Copy link

ursabot commented Feb 12, 2023

Benchmark runs are scheduled for baseline = 8a609dc and contender = 50f6e69. 50f6e69 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/basic_explain branch February 12, 2023 21:06
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