Skip to content

[Bug] Join hint lose efficacy when the table is in colocate group. #4496

@HappenLee

Description

@HappenLee

Describe the bug
There is a table baseall, hash by k1.

The baseall join itself, it should be colocate join. But sometime we need other join way, so we can use join hint,
but the colocate join can lose efficacy of join hint

desc select * from baseall a join [shuffle] baseall b on a.k1 = b.k1;

it should be shuffle join, but it still be colocate join.

|   2:HASH JOIN                                                                                                                                                                                                                                                     |
|   |  join op: INNER JOIN                                                                                                                                                                                                                                          |
|   |  hash predicates:                                                                                                                                                                                                                                             |
|   |  colocate: true                                                                                                                                                                                                                                               |
|   |  equal join conjunct: `a`.`k1` = `b`.`k1` 

Expected behavior
The user should have the power to chose join way by hoin hint

 2:HASH JOIN                                                                                                                                                                                                                                                     |
|   |  join op: INNER JOIN (PARTITIONED)                                                                                                                                                                                                                            |
|   |  hash predicates:                                                                                                                                                                                                                                             |
|   |  colocate: false, reason: Has join hint                                                                                                                                                                                                                       |
|   |  equal join conjunct: `a`.`k1` = `b`.`k1`                                                                                                                                                                                                                     |
|   |                                           

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