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/06/17 06:08:33 UTC

[GitHub] [shardingsphere] edenpan opened a new issue, #18406: Oracle Date Type Sharding Query Route

edenpan opened a new issue, #18406:
URL: https://github.com/apache/shardingsphere/issues/18406

   ## Question
   
   **For English only**, other languages will not accept.
   The Version: V 5.1.0  
   
   The Oracle select SQL by the date needs to use the to_char or to_date, for example, my query SQL as below:
   
   `                
   SELECT
       * FROM tradeList WHERE 1 = 1
     AND TRADE_DATE = to_date( '20210601', 'yyyymmdd' )
   `
   It seems that the query not sharding via the sharding key: TRADE_DATE . 
   So, if there are any suggestions for oracle query via date field.
   
   Below is my shardingsphere setting:
   `
   spring.shardingsphere.rules.sharding.tables.TRADELIST.actual-data-nodes=db0.TRADELIST_$->{2021..2021}$->{6..12}
   spring.shardingsphere.rules.sharding.defaultShardingColumn = TRADE_DATE
   spring.shardingsphere.rules.sharding.default-table-strategy.standard.sharding-column=TRADE_DATE
   spring.shardingsphere.rules.sharding.default-table-strategy.standard.sharding-algorithm-name=shardingalgorithmbymonth2
   spring.shardingsphere.rules.sharding.tables.TRADELIST.table-strategy.standard.sharding-column=TRADE_DATE
   spring.shardingsphere.rules.sharding.tables.TRADELIST.table-strategy.standard.sharding-algorithm-name=shardingalgorithmbymonth2
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.shardingalgorithmbymonth2.type=INTERVAL
   spring.shardingsphere.rules.sharding.sharding-algorithms.shardingalgorithmbymonth2.props.datetime-pattern=yyyy-MM-dd HH:mm:ss.SSS
   spring.shardingsphere.rules.sharding.sharding-algorithms.shardingalgorithmbymonth2.props.datetime-lower=2021-06-01 00:00:00.000
   spring.shardingsphere.rules.sharding.sharding-algorithms.shardingalgorithmbymonth2.props.datetime-upper=2021-12-31 00:00:00.000
   spring.shardingsphere.rules.sharding.sharding-algorithms.shardingalgorithmbymonth2.props.sharding-suffix-pattern=yyyyM
   spring.shardingsphere.rules.sharding.sharding-algorithms.shardingalgorithmbymonth2.props.datetime-interval-amount=1
   spring.shardingsphere.rules.sharding.sharding-algorithms.shardingalgorithmbymonth2.props.datetime-interval-unit=months
   
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   
   `
   
   


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

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


[GitHub] [shardingsphere] terrymanu commented on issue #18406: Oracle Date Type Sharding Query Route

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

   @edenpan Hi, can you change the title, I can't get your point


-- 
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] tuichenchuxin commented on issue #18406: Oracle Date Type Sharding Query Route

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

   use function with sharding key is not supported. You can calculate first.


-- 
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] edenpan commented on issue #18406: How to use Oracle Date Type as Sharding Query Route key

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

   > use function with sharding key is not supported. You can calculate first.
   
   But it was used the function with sharding value. ok. I will try to convert the DateTime to LocalDateTime. 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] edenpan closed issue #18406: How to use Oracle Date Type as Sharding Query Route key

Posted by GitBox <gi...@apache.org>.
edenpan closed issue #18406: How to use Oracle Date Type as Sharding Query Route key
URL: https://github.com/apache/shardingsphere/issues/18406


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