Skip to content
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

[Enhancement](doris-future) Support "REGR_" aggregation functions (PART I) #38974

Open
2 of 3 tasks
zclllyybb opened this issue Aug 6, 2024 · 3 comments · May be fixed by #39278
Open
2 of 3 tasks

[Enhancement](doris-future) Support "REGR_" aggregation functions (PART I) #38974

zclllyybb opened this issue Aug 6, 2024 · 3 comments · May be fixed by #39278

Comments

@zclllyybb
Copy link
Contributor

zclllyybb commented Aug 6, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Description

We are going to support all regression functions in pg. You can see them in https://www.postgresql.org/docs/16/functions-aggregate.html with regr_ prefix. And considring the difficulty of this task, it will be nice for community as "good first issue".

In this issue, you should implement function regr_avgx, regr_avgy and regr_count

If you'd like to work on it, please comment to let me know. I'll help you to achieve this.

Solution

you can found an example of implementation of a aggregate function here

for regr_avgx and regr_avgy, you could only impl the FE function signature, and add a rule in ExpressionOptimization.java to rewrite them to avg() function because it has equivalent form of it. you can see ArrayContainToArrayOverlap rule to learn to write your own.

for regr_count you should completely impl it execution logic.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@therehello
Copy link

Could you assign it to me?

@zclllyybb
Copy link
Contributor Author

Could you assign it to me?

yes~ feel free to communicate when you meet problem.

@morrySnow
Copy link
Contributor

@zclllyybb regr_avgy and regr_avgx is not equal avg. refer to https://docs.snowflake.com/en/sql-reference/functions/regr_avgx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants