-
Notifications
You must be signed in to change notification settings - Fork 69
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
Support approx_count_distinct #499
Conversation
sql/pg_duckdb--0.2.0--0.3.0.sql
Outdated
@@ -0,0 +1,9 @@ | |||
CREATE FUNCTION @[email protected]_count_distinct(a anyelement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should no be added as a function, but as a function but as an aggregate. Currently the following query fails on your test schema because of that:
> SELECT approx_count_distinct(a) FROM t group by b;
ERROR: 42803: column "t.a" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT approx_count_distinct(a) FROM t group by b;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch!!
sql/pg_duckdb--0.2.0--0.3.0.sql
Outdated
@@ -0,0 +1,9 @@ | |||
CREATE FUNCTION @[email protected]_count_distinct(a anyelement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this should be created in @extschema@
(i.e. the public
schema) or the duckdb
schema. I think @extschema@
is probably fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion. I was just following the existing functions
5a816ad
to
70231b2
Compare
Change |
2352ea2
to
3d4f730
Compare
@JelteF Could you please take a look again? Thanks! |
Add support for
approx_count_distinct()