Skip to content

DISTINCT is not implemented for window functions #4545

@drorspei

Description

@drorspei

What happens?

Count distinct over windows is not currently supported. For example:

select count(distinct a) over(partition by b) from c

Prints the error "DISTINCT is not implemented for window functions."

The lack of support starts in the parser and is inherited from the pg code.

If I wanted to work on this, where would I start?
Do you think this is a reasonable thing to try to implement? (given your knowledge and preferences, as well as the fact that postgres never did (and as far as I can tell neither did presto, Spark or mssql))

To Reproduce

select count(distinct a) over(partition by b) from c

OS:

Linux

DuckDB Version:

0.4.1.dev2358

DuckDB Client:

Python

Full Name:

Dror Speiser

Affiliation:

None

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions