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/12/17 02:33:33 UTC

[GitHub] [shardingsphere] ryan-hao edited a comment on issue #14125: java.lang.ClassCastException: java.sql.Time cannot be cast to java.sql.Timestamp

ryan-hao edited a comment on issue #14125:
URL: https://github.com/apache/shardingsphere/issues/14125#issuecomment-996362185


   > Hi @ryan-hao, thank you for your feedback, can you provide the step to reproduce this exception?
   
   database: mysql
   `
   CREATE TABLE `ind_test_1` (
     `id` bigint(20) NOT NULL,
     `info_date` date DEFAULT NULL,
     `info_time` time DEFAULT NULL,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
   
   CREATE TABLE `ind_test_2` (
     `id` bigint(20) NOT NULL,
     `info_date` date DEFAULT NULL,
     `info_time` time DEFAULT NULL,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
   `
   
   entity
   `
     @Data
     public class TestDateTime {
        private Long id;
     
        private LocalDate infoDate;
     
        private LocalTime infoTime;
     }
   `
   
   
   ![image](https://user-images.githubusercontent.com/50565298/146475188-c7e5841e-3680-44c0-807e-5a7e9dbad50a.png)
   
       rules:
         sharding:
           tables:
             ind_test:
               actual-data-nodes: test-db.ind_test_$->{1..2}
               table-strategy:
                 standard:
                   sharding-column: id
                   sharding-algorithm-name: ind-test-inline
               key-generate-strategy:
                 column: id
                 key-generator-name: snowflake
           sharding-algorithms:
             ind-test-inline:
               type: INLINE
               props:
                 algorithm-expression: ind_test_$->{id % 2 + 1}
           key-generators:
             snowflake:
               type: SNOWFLAKE
               props:
                 worker-id: 123


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