Skip to content

[Bug] After left join, there are two rows of the same key after group by #9544

@gj-zhang

Description

@gj-zhang

Search before asking

  • I had searched in the issues and found no similar issues.

Version

1.0.0-rc03

What's Wrong?

image

What You Expected?

result one row

How to Reproduce?

CREATE TABLE `left_table`
(
    `id`        text NULL COMMENT "",
    `device_id` text NULL COMMENT ""
) ENGINE = OLAP UNIQUE KEY(`id`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`id`) BUCKETS 4
PROPERTIES (
"replication_allocation" = "tag.location.default: 2",
"in_memory" = "false",
"storage_format" = "V2"
);

insert into left_table values ('1', '1'),('2', '2'), ('3', '3'), ('4', '4');

CREATE TABLE `right_table`
(
    `device_id`   text NULL COMMENT "",
    `device_name` text NULL COMMENT ""
) ENGINE = OLAP UNIQUE KEY(`device_id`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`device_id`) BUCKETS 4
PROPERTIES (
"replication_allocation" = "tag.location.default: 2",
"in_memory" = "false",
"storage_format" = "V2"
);

insert into right_table values ('1', 'device_name1'), ('3', null);

select count(left_table.device_id), rt.device_name
from left_table
         left join right_table rt
                   on left_table.device_id = rt.device_id
where rt.device_name is null
group by rt.device_name
order by rt.device_name nulls first

Anything Else?

merge #8822 code

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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