You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/28 09:52:17 UTC

[GitHub] [shardingsphere] mark4z opened a new issue #7129: left join can not be routed

mark4z opened a new issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129


   ## Bug Report
   when i want do like this:
   select ... 
   from A left join B on a.id = b.id and b.`key` = ?
   where ...
   B has been sharding and the key is `key`
   A has more rows than B,so if i use left join, i should put the predicates on `on` rather than `where`. but i got a error which said 
   me have not Sharding Key. 
   
   
   ### Which version of ShardingSphere did you use?
   4.0.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] jingshanglu commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-693216422


   > > @mark4z Can you show more stack info?
   > 
   > Sorry, I can't resume it now. but actually it doesn't work.
   > 
   > like this:
   > 
   > Actual SQL: ds0 ::: select count(1) from forward left join back0 on back0.id = forward.id and back0.price = 100 where forward.id = 1
   > Actual SQL: ds0 ::: select count(1) from forward left join back1 on back1.id = forward.id and back1.price = 100 where forward.id = 1
   > 
   > ‘back’ is a table which has been sharing and the key is 'price'.
   
   @mark4z `forward` is a actualTable? can you give the correct rewrited sql for this sql?


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-693222622


   > @mark4z You can try the master branch, the rewriting has been greatly improved on master branch.
   
   Thks,if i have time, i'll dothing for this project.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] jingshanglu commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-689456341


   @mark4z Can you show more stack info?


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-691073385






----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z edited a comment on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z edited a comment on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-682474487


   > you can try:
   > 
   > ```
   > select ...
   > from A left join B on a.id = b.id 
   > where b.key = ? ...
   > ```
   
   You know, it equals inner 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.

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



[GitHub] [shardingsphere] kimmking closed issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
kimmking closed issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129


   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-691073385


   > @mark4z Can you show more stack info?
   
   Sorry, I can't resume it now. but actually it doesn't work.
   
   
   
   like this:
   
   Actual SQL: ds0 ::: select count(1) from forward left join back0 on back0.id = forward.id and back0.price = 100 where forward.id = 1
   Actual SQL: ds0 ::: select count(1) from forward left join back1 on back1.id = forward.id and back1.price = 100 where forward.id = 1
   
   ‘back’ is a table which has been sharing and the key is 'price'. 
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-682474487


   > you can try:
   > 
   > ```
   > select ...
   > from A left join B on a.id = b.id 
   > where b.key = ? ...
   > ```
   
   You know, left join  in ON-Clause equals inner 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.

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



[GitHub] [shardingsphere] mark4z edited a comment on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z edited a comment on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-693222622


   > @mark4z You can try the master branch, the rewriting has been greatly improved on master branch.
   
   Thks,if i have time, i'll do sth for this project.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] jingshanglu commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-693217968


   @mark4z You can try the master branch, the rewriting  has been greatly improved on master branch.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-686237893


   > you can try:
   > 
   > ```
   > select ...
   > from A left join B on a.id = b.id 
   > where b.key = ? ...
   > ```
   
   So, sharding not supported this.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] kimmking commented on issue #7129: left join can not be routed

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-682460781


   you can try:
   ```
   select ...
   from A left join B on a.id = b.id 
   where b.key = ? ...
   ```


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] kimmking commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-719445660


   As this issue have no more infomation for a long time, we close it now.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z edited a comment on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z edited a comment on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-682474487


   > you can try:
   > 
   > ```
   > select ...
   > from A left join B on a.id = b.id 
   > where b.key = ? ...
   > ```
   
   You know, left join  in Where-Clause equals inner 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.

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



[GitHub] [shardingsphere] mark4z commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-691073385


   > @mark4z Can you show more stack info?
   
   Sorry, I can't resume it now. but actually it doesn't work.
   
   
   
   like this:
   
   Actual SQL: ds0 ::: select count(1) from forward left join back0 on back0.id = forward.id and back0.price = 100 where forward.id = 1
   Actual SQL: ds0 ::: select count(1) from forward left join back1 on back1.id = forward.id and back1.price = 100 where forward.id = 1
   
   ‘back’ is a table which has been sharing and the key is 'price'. 
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] mark4z commented on issue #7129: Sharding key in ON-Clause(Not Where-Clause) cause a error "No Sharding Key"

Posted by GitBox <gi...@apache.org>.
mark4z commented on issue #7129:
URL: https://github.com/apache/shardingsphere/issues/7129#issuecomment-691073385


   > @mark4z Can you show more stack info?
   
   Sorry, I can't resume it now. but actually it doesn't work.
   
   
   
   like this:
   
   Actual SQL: ds0 ::: select count(1) from forward left join back0 on back0.id = forward.id and back0.price = 100 where forward.id = 1
   Actual SQL: ds0 ::: select count(1) from forward left join back1 on back1.id = forward.id and back1.price = 100 where forward.id = 1
   
   ‘back’ is a table which has been sharing and the key is 'price'. 
   


----------------------------------------------------------------
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.

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