-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tech Request]: Agg and Window function framework #9231
Comments
暂无计划,如果1.0只有1个多月的话,可能没时间做这个。 |
今天开始先做点聚合代码的代码清理工作。 计划先删除以下接口:Dup, GetInputTypes, WildAggRealloc等。不过需要先看看怎么删。 |
count聚合可以自己单独走一个逻辑,不需要走通用的单列聚合框架。这个后面单独做。不和这次改bug一起弄。 |
9e013fa |
已修复旧框架没有null值处理错误和const vector的问题。 后续计划是:1. 去除vs, es, srcs等,改成采用vector维护。 2. 移除wild agg reallocate等诡异接口,减少二次分配。 |
太难搞了 1.0搞不完 循环引用和范型的问题太多了 很难把接口抽象出来。 |
@fengttt 当前实现一个聚合函数需要关心的有以下几个方法。
以 issue 描述的 avg为例,其聚合函数实现如下:
具体代码可以看1.2分支或者main分支的 |
For spill, we still miss how to spill the context. This might need 2 method, if the context will spill out some fixed length bytes or variable length bytes. Please add this info. And please create a doc in the docs repo (if you already have one, please link here). Thank you. |
I see there is a marshal/unmarshal method pair, so please update doc. Not clear if use marshal/unmarshal is efficient -- because after this we will always treat marshaled context as bytes, that is, varlength. Spill/load varlength is inherently slower than fixed length. |
Why do you want to refactor this code?
Describe the solution you'd like
Window function also need its new framework, and not as clear as agg, but here is something to get started.
We assume window does not need save/merge (one window function/frame will execute at one node.)
init -- init context and state
transit -- add a new value
-- note that transit may output some rows, 0 or many
finalize -- output, 0 or many rows.
@iamlinjunhong @gavinyue please take a look at this one.
Describe alternatives you've considered
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: