Skip to content

sql: distinct on json columns errors out #45216

@rohany

Description

@rohany
create table t (x jsonb);
insert into t values ('{"f":"b"}');
select distinct (x) from t;
ERROR: unable to encode table key: *tree.DJSON

This stems from the fact that we use the table encoding of datums to hash them in the distinct operator, which means that only types that are indexable will be able to be distinctable.

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