[VL] A bug about replacing spark sort agg with gluten hash agg
- Dominant language
- Scala
- Stars
- 1.6k
- Forks
- 657
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 80
Description
### Backend
VL (Velox) and CH(ClickHouse)
### Bug description
When the Final SortAggregate fallback, the Partial SortAggregate should also fallback to ensure data accuracy
A test query:
```
SELECT T1.l_partkey,
T2.p_comment,
COALESCE(T2.active_label, T1.l_partkey) AS active_label
FROM $table T1
LEFT JOIN
(
SELECT t1.l_partkey l_partkey,
NULL active_label,
MAX(t1.p_comment) AS p_comment
FROM $table t1
LEFT JOIN
$table t2
ON t1.l_partkey = t2.l_partkey
GROUP BY
t1.l_partkey
) T2
ON T1.l_partkey = T2.l_partkey
```

### Spark version
None
### Spark configurations
_No response_
### System information
_No response_
### Relevant logs
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.