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

bug: UDAF can not be used as window function #17560

Closed
wangrunji0408 opened this issue Jul 4, 2024 · 0 comments · Fixed by #18181
Closed

bug: UDAF can not be used as window function #17560

wangrunji0408 opened this issue Jul 4, 2024 · 0 comments · Fixed by #18181
Assignees
Labels
type/bug Something isn't working
Milestone

Comments

@wangrunji0408
Copy link
Contributor

wangrunji0408 commented Jul 4, 2024

Describe the bug

No response

Error message/log

Invalid input syntax: column must appear in the GROUP BY clause or be used in an aggregate function

To Reproduce

create aggregate sum00(value int) returns int language python as $$
def create_state():
    return 0
def accumulate(state, value):
    return state + value
def retract(state, value):
    return state - value
def finish(state):
    return state
$$;

select t.value, sum00(weight) OVER (PARTITION BY value) from (values (1, 1), (null, 2), (3, 3)) as t(value, weight);

Expected behavior

I expect to see the output:

 value | weighted_avg 
-------+--------------
     1 |            1
     3 |            3
(2 rows)

However, it returned this error:

ERROR:  Failed to run the query

Caused by:
  Invalid input syntax: column must appear in the GROUP BY clause or be used in an aggregate function

How did you deploy RisingWave?

./risedev p

The version of RisingWave

latest main branch

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants