Uh oh!
There was an error while loading. Please reload this page.
Add Aggregation fuzzer framework - #12667
Conversation
alamb
commented
Sep 29, 2024
😍 😍 😍 😍 |
d1f5aea to
6ad27f5CompareRest works:
|
b059373 to
cf82eb7Compare@alamb I found the new fuzz cases(based on aggregation fuzzer) failed after I rebase main. The failed new case: I am more sure now, it may be due to the process of null, when I switch the Updated |
Rachelint
commented
Oct 4, 2024
I found the reason and have submitted a pr to fix it #12758 |
alamb
commented
Oct 4, 2024
Testing for the win! |
The tests' run time after modifying |
@alamb I have added tests to cover more aggregations:
I make it through the simple implementation about randomly select sql memtioned in #12667 (comment)
Now the testcase may be like: // Build fuzzerlet fuzzer = builder
.data_gen_config(data_gen_config).data_gen_rounds(16).add_sql("SELECT sum(a) FROM fuzz_table").add_sql("SELECT sum(distinct a) FROM fuzz_table").add_sql("SELECT max(a) FROM fuzz_table").add_sql("SELECT min(a) FROM fuzz_table").add_sql("SELECT count(a) FROM fuzz_table").add_sql("SELECT count(distinct a) FROM fuzz_table").add_sql("SELECT avg(a) FROM fuzz_table").table_name("fuzz_table").build();And unforunately, seems a bug about |
alamb
commented
Oct 8, 2024
Yes, let's handle that as a separate PR / issue. |
alamb
left a comment
There was a problem hiding this comment.
Thank you again @Rachelint -- I think this is great and I'll plan to merge it tomorrow unless anyone else would like time to review
Then we can work on follow on items in other PRs
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| /// Fuzz test for group by `sting + int64` | ||
| #[tokio::test(flavor = "multi_thread")] |
There was a problem hiding this comment.
I meant like
#[tokio::test]
async fn test_basic_string_aggr_group_by_mixed_string_int64_1() {
...
}
#[tokio::test]
async fn test_basic_string_aggr_group_by_mixed_string_int64_2() {
...
}
Rather than a single test that was multi-threaded
alamb
commented
Oct 9, 2024
Thanks again @Rachelint -- this is so great |
alamb
commented
Oct 9, 2024
I am working on filing the error that this found for min/max |
alamb
commented
Oct 9, 2024
I also have some ideas on how to improve the error reporting here |
Rachelint
commented
Oct 9, 2024
Nice, the error reporting is indeed not so readable currently |
Rachelint
commented
Oct 9, 2024
Maybe #5131 will help? The error seems similar. |
alamb
commented
Oct 9, 2024
#12832 has a proposal for improved error reporting |
| let fuzzer = builder | ||
| .data_gen_config(data_gen_config) | ||
| .data_gen_rounds(8) | ||
| // FIXME: Encounter error in min/max |
alamb
commented
Oct 10, 2024
BTW this found another bug in #12792 See https://github.com/apache/datafusion/actions/runs/11272685143/job/31348663515?pr=12792 ❤️ |
Which issue does this PR close?
Part of #12114
Rationale for this change
The aggregation fuzz tests maybe not enough, becasue there are so many optimizations in aggregation in datafusion.
For improving the testing, the first thing to do may be building a framework to make creating testcase easier.
This pr aimed to introduce such a framework.
What changes are included in this PR?
Design an
AggregationFuzzerto make creating testcases for aggregation easier.Two key components in
AggregationFuzzerareDatasetGeneratorandSessionContextGenerator.In
AggregationFuzzer(with a deinfedqueryrepresented by sql currently):Multiple
datasets will be generated byDatasetGeneratorfirstly.And then for a specific
dataset, multipleSessionContextwith the random params about aggreagtion, and a baselineSessionContextwill be generated.Still for the specific
dataset, each randomly generatedSessionContext+basline result(generated fromdataset+ baslineSessionContext) will be used to buildAggregationFuzzTestTask.In
AggregationFuzzTestTask, we will run thequerywithdataset+ relatedSessionContext, then we compare the result withbasline result. If inconsistency found, report it and panic.Finally, all
AggregationFuzzTestTasks will be run in parallel inAggregationFuzzerAre these changes tested?
Test by uts.
Are there any user-facing changes?
No,