You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.
<!-- for spring namespace -->
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-namespace</artifactId>
<version>4.1.0</version>
</dependency>
Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
Expected behavior
SNOWFLAKE config can use
Actual behavior
Cause: java.lang.IllegalArgumentException: Sharding value must implements Comparable.
Reason analyze (If you can)
when insert can not bind genrate sharding value
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Example codes for reproduce this issue (such as a github link).
@test
public void testInsert() {
for (int i = 0; i < 10; i++) {
Order order = new Order();
order.setOrderId(Long.valueOf(i));
order.setUserId(20001);
order.setStatus("insert");
order.setCreateDate(DateUtils.addYears(new Date(),-1));
// order.setOrderNo(IdWorker.getId());
orderShardingMapper.insert(order);
}
for (int i = 0; i < 10; i++) {
Order order = new Order();
order.setOrderId(Long.valueOf(i));
order.setUserId(20001);
order.setStatus("insert");
order.setCreateDate(new Date());
//order.setOrderNo(IdWorker.getId());
orderShardingMapper.insert(order);
}
}
The text was updated successfully, but these errors were encountered:
Bug Report
Which version of ShardingSphere did you use?
org.apache.shardingsphere sharding-jdbc-spring-boot-starter 4.1.0Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
Expected behavior
SNOWFLAKE config can use
Actual behavior
Cause: java.lang.IllegalArgumentException: Sharding value must implements Comparable.
Reason analyze (If you can)
when insert can not bind genrate sharding value
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Example codes for reproduce this issue (such as a github link).
sharding:
tables:
t_order:
key-generator:
column: order_no
type: SNOWFLAKE
actual-data-nodes: ds-$->{2019..2020}.t_order$->{0..1}
database-strategy:
standard:
sharding-column: create_date
precise-algorithm-class-name: com.bule.spring.dao.sharding.TimeDatabaseShardingAlgorithm
table-strategy:
inline:
sharding-column: order_no
algorithm-expression: t_order$->{order_no % 2}
@test
public void testInsert() {
for (int i = 0; i < 10; i++) {
Order order = new Order();
order.setOrderId(Long.valueOf(i));
order.setUserId(20001);
order.setStatus("insert");
order.setCreateDate(DateUtils.addYears(new Date(),-1));
// order.setOrderNo(IdWorker.getId());
orderShardingMapper.insert(order);
}
for (int i = 0; i < 10; i++) {
Order order = new Order();
order.setOrderId(Long.valueOf(i));
order.setUserId(20001);
order.setStatus("insert");
order.setCreateDate(new Date());
//order.setOrderNo(IdWorker.getId());
orderShardingMapper.insert(order);
}
}
The text was updated successfully, but these errors were encountered: