apache / apache/datafusion

Tracking: improve aggreagation fuzzer

Open
#15,870 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

I found aggregation fuzzer are still hard to use when I act as an user currently.
Some points I noticed can be improved:

### 1. Aggregation function generation
Now it is still hard/possible to generate sql having multiple aggregated functions like:
```text
SELECT count(string), sum(number) FROM xxx GROUP BY xxx;
```

It is due to `aggregate_function` and `aggregate_arguments` are set respectively. if we set `mutiple aggregate_functions`, columns in the respectly set `aggregate_arguments` may be not supported in some of the `aggregate_functions`.
For example,
```
If we set:
aggregate_arguments: [string, primitive]
aggregate_function: [sum, count]

Then wrong generated sql possible to be generated:
SELECT sum(string) FROM t GROUP BY xxx
```

### 2. Group by columns ordering
Noticed by @jayzhan211 , it is hard to control the ordering of group by columns right now.
https://github.com/apache/datafusion/pull/15851#issuecomment-2831689650

### Describe the solution you'd like

_No response_

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names the aggregation fuzzer but no file or test entry point. Start by locating the aggregate_function, aggregate_arguments, and GROUP BY generation code; then add coverage for compatible aggregate arguments and controllable GROUP BY column ordering, including the examples described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.