implement aggregate functions under the new framework
This PR https://github.com/pingcap/tidb/pull/6852 introduced the new framework to execute aggregate functions. Now the rest work is to rewrite every aggregate function under this new framework. The aggregate functions need to rewrite are listed in executor/aggfuncs/builder.go, which are:
- [x]
COUNT@Xuanwo - [x]
SUM@laidahe - [x]
AVG@zz-jason #6951 - [x]
FIRSTROW@XuHuaiyu - [x]
MAX@XuHuaiyu - [x]
MIN@XuHuaiyu - [x]
GROUP_CONCAT@XuHuaiyu - [x]
BIT_OR@crazycs520 - [x]
BIT_XOR@XuHuaiyu - [x]
BIT_AND@XuHuaiyu
To rewrite a function, take https://github.com/pingcap/tidb/pull/6951 as an example, you need to:
- implement the aggregate function in file executor/aggfuncs/func_xxx.go
- supplement the
buildXXX()function for the corresponding aggregate function in executor/aggfuncs/builder.go - put the implemented aggregate functions into the
varcode block in file executor/aggfuncs/aggfuncs.go for code navigation.
If you are going to rewrite one of the above aggregate functions, please firstly make a comment here to let other contributors know. Feel free to contribute :grin:
I'm interested to rewrite COUNT and SUM function.
Really thank you for your support. @Xuanwo
To make this issue be finished as soon as possible,
if possible, you may implement COUNT first,
and continue to work on SUM after the above work finished
if there is no one else who is working on SUM?
@XuHuaiyu OK, I will implement COUNT first.
I want to implement SUM.OK?
@laidahe Sure, thanks for your participation!😁
hi, @laidahe friendly ping ^_^ Any problem you've got these days? If you need any help, feel free to comment here.
All the aggregate functions are implemented, close this issue now.