Skip to content

support countIf(DISTINCT col1, <cond_expr>) #11517

@zzn01

Description

@zzn01

(you don't have to strictly follow this form)

Use case
when trying to translate postgres sql to clickhouse sql, COUNT(col1) FILTER (WHERE <cond_expr>) is equal with countIf(col1, <cond_expr>). it would be much more consistent if
COUNT(DISTINCT col1) FILTER (WHERE <cond_expr>) can translate as countIf(DISTINCT col1, <cond_expr>).

Describe the solution you'd like
As count(DISTINCT col1) is supported, looks like it's reasonable to support countIf(DISTINCT col1, <cond_expr>) .

Describe alternatives you've considered
uniqExactIf(col1, <cond_expr>)

Additional context

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions