Skip to content

Rewrite count(distinct if(bool, bitmap, null)) to bitmap_union_count #4200

@liutang123

Description

@liutang123

Some time, users want to execute a sql like follows:

select count(distinct if(id = 1, id2, null)) , count(distinct id2) from test.bitmap_table

Now, IF Expr will return decimal type and the result is meaningless.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions