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 2022/03/29 09:22:05 UTC

[GitHub] [shardingsphere] zm52hz opened a new issue #16469: The problem of association between two sub-tables

zm52hz opened a new issue #16469:
URL: https://github.com/apache/shardingsphere/issues/16469


   ## Question
   version : ShardingSphere-JDBC 5.1.0
   
   According to the logic of ShardingSphere, the query condition has no sharding field and the routing engine will use the Cartesian product for it.
   Now we have the following SQL:
      SQL1: select a.id ,a.time,b.id from photo a left join alarm_photo b on a.alarm_id = b.id 
   Logic Table photo has two actual tables:  photo_202201,photo_202203 ,  two months has one actual table;
   Logic Table alarm_photo has three actual tables: alarm_photo_202201,alarm_photo_202202,alarm_photo_202203, one months has one acutal table;
   Logic table photo has one data :[ id:1、date:'20220201'  ]、and the data is in actual table photo_202201
   Logic alarm_photo has no data.
   Now I execute the above SQL1(left join ! not right join)、and get the three results: 
   [id:1,time:'20220201', id null],[id:1,time:'20220201', id null],[id:1,time:'20220201', id null]
   
   This is not what I expected, I think there should be only one data. 
   Why is this, I know it's caused by the Cartesian product, but why doesn't ShardingSphere solve this problem?
   Can you give me an answer ?thanks.
   
   
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #16469: The problem of association between two sub-tables

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


   Duplicate with #14418.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #16469: The problem of association between two sub-tables

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


   @zm52hz Thank you for your feedback, this maybe a bug, I will investigate this problem.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] RaigorJiang commented on issue #16469: The problem of association between two sub-tables

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


   This problem is not easy to solve.
   Hi @strongduanmu  Can you provide some suggestions?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu closed issue #16469: The problem of association between two sub-tables

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


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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