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 2021/11/18 07:55:15 UTC

[GitHub] [shardingsphere] yiyayamaya opened a new issue #13679: Sharding Tables join does not behave as expected

yiyayamaya opened a new issue #13679:
URL: https://github.com/apache/shardingsphere/issues/13679


   Hi!
   
   ### Which version of ShardingSphere did you use?
   		<dependency>
   			<groupId>org.apache.shardingsphere</groupId>
   			<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
   			<version>4.1.1</version>
   		</dependency>
   		<dependency>
   			<groupId>org.apache.shardingsphere</groupId>
   			<artifactId>sharding-jdbc-spring-namespace</artifactId>
   			<version>4.1.1</version>
   		</dependency>
   
   
   
   ### Expected behavior
   
   There are two actual tables(atc_task_logs_20211117 and atc_task_logs_20211118) splited from one logic table (atc_task_logs).
   I use created_time as the split column and it works well.
   
   I want join atc_task_logs_20211117 and atc_task_logs_20211118 on a column they both have. 
   
   I expect the  sql be something like 
   
   ```
   select *
   FROM atc_task_logs_20211117 firstDay
            JOIN atc_task_logs_20211118 secondDay
                 ON firstDay.hash_key = secondDay.hash_key
   
   ```
   
   I wrote it like 
   
   ```
           select
               *
           FROM
               atc_task_logs   firstDay JOIN atc_task_logs  secondDay  ON firstDay.hash_key = secondDay.hash_key
           WHERE
            <![CDATA[ firstDay.created_time >= '2021-11-17 00:00:00'  ]]>
            and
            <![CDATA[  firstDay.created_time <= '2021-11-17 23:59:59'   ]]>
            and
           <![CDATA[ secondDay.created_time >= '2021-11-18 00:00:00'  ]]>
            and
            <![CDATA[  secondDay.created_time <= '2021-11-18 23:59:59'  ]]>
   
   ```
   
   
   
   
   ### Actual behavior
   ![image](https://user-images.githubusercontent.com/45009320/142374478-c2447ad2-4205-4d0e-80cb-6e9bce97a695.png)
   
   
   
   
   ### Reason analyze (If you can)
   
   It may because I join two actual tables from the same logic table?
   or the split column from two tables are the same?
   
   
   Thank you.


-- 
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 #13679: Sharding Tables join does not behave as expected

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


   @yiyayamaya Thank you for your feedback, 4.x version does not support non-binding sharding table join query, because there may be cross-database situations.


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