apache / apache/gluten

[VL] A bug about replacing spark sort agg with gluten hash agg

Open
#3,237 6 comments 0 reactions 0 assignees View on GitHub
bug triage
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
```

![image](https://github.com/oap-project/gluten/assets/39684231/28edb8b1-edbc-4970-8de2-c6bb27296b25)

### Spark version

None

### Spark configurations

_No response_

### System information

_No response_

### Relevant logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.