apache / incubator-gluten

Gluten is a middle layer responsible for offloading JVM-based SQL engines' execution to native engines.
https://gluten.apache.org/
Apache License 2.0
1.14k stars 416 forks source link

[CH]Pushdown extra projection before `expand` #7112

Closed lgbo-ustc closed 6 days ago

lgbo-ustc commented 1 week ago

Description

For following query


select x, y, count(if(a > 0, b, c)) as n from t
group by x, y with cube

It will add an extra projection after expand for pre-calculating if(a>0,b, c).

For performance, we should push down the projection before expand

lgbo-ustc commented 1 week ago

before pushdown image

after pushdown image