You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "cambyzju (via GitHub)" <gi...@apache.org> on 2024/06/14 11:42:33 UTC

[I] [Bug] wrong colocate join used [doris]

cambyzju opened a new issue, #36324:
URL: https://github.com/apache/doris/issues/36324

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   nereids planner has this problem, all versions.
   
   ### What's Wrong?
   
   colocate group keys do not the same as on condition, we should no use colocate join, then make the result do not correctly.
   
   ### What You Expected?
   
   get correct result
   
   ### How to Reproduce?
   
   1. create table a, use k1 as distributed key
   ```
   CREATE TABLE `a` (
     `k1` INT NOT NULL,
     `k2` INT NOT NULL,
     `v` INT SUM NULL
   ) ENGINE=OLAP
   AGGREGATE KEY(`k1`, `k2`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`k1`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "colocate_with" = "k1_group"
   ); 
   ```
   
   2. create table b, use k2 as distributed key
   ```
   CREATE TABLE `b` (
     `k1` INT NOT NULL,
     `k2` INT NOT NULL,
     `v` INT SUM NULL
   ) ENGINE=OLAP
   AGGREGATE KEY(`k1`, `k2`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`k2`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "colocate_with" = "k1_group"
   ); 
   ```
   
   3. and table a and b use the same colocate group: `k1_group`
   4. add some data to table and table b
   ```
   insert into a values(1,2,3);
   insert into b values(1,2,3);
   ```
   5. check the planner, we found colocate join is used. Actually in this case, we should not use colocate join:
   ```
   explain select * from a join b on a.k1=b.k1 and a.k2=b.k2;
   ```
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] wrong colocate join used [doris]

Posted by "cambyzju (via GitHub)" <gi...@apache.org>.
cambyzju closed issue #36324: [Bug] wrong colocate join used
URL: https://github.com/apache/doris/issues/36324


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] wrong colocate join used [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on issue #36324:
URL: https://github.com/apache/doris/issues/36324#issuecomment-2213349101

   could u explain why cannot use colocate join?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org