qingchengshi commented on issue #22829:
URL:
https://github.com/apache/shardingsphere/issues/22829#issuecomment-1347707331
query criteria startTime=20221108&endTime=20221209
CommonStandardShardingAlgorithm assemble tables
["attendance_three_well_202211","attendance_three_well_202212"]
11:25:48.410 [http-nio-9090-exec-2] INFO ShardingSphere-SQL - Logic SQL:
SELECT COUNT(1) FROM attendance_three_well WHERE (is_use = ? AND day_date >= ?
AND day_date <= ?)
11:25:48.410 [http-nio-9090-exec-2] INFO ShardingSphere-SQL - SQLStatement:
MySQLSelectStatement(limit=Optional.empty, lock=Optional.empty,
window=Optional.empty)
11:25:48.411 [http-nio-9090-exec-2] INFO ShardingSphere-SQL - Actual SQL:
m1 ::: SELECT COUNT(1) FROM attendance_three_well_202211 WHERE (is_use = ? AND
day_date >= ? AND day_date <= ?) ::: [true, 20221108, 20221209]
11:25:48.411 [http-nio-9090-exec-2] INFO ShardingSphere-SQL - Actual SQL:
m1 ::: SELECT COUNT(1) FROM attendance_three_well_202212 WHERE (is_use = ? AND
day_date >= ? AND day_date <= ?) ::: [true, 20221108, 20221209]
@Override
public Collection<String> doSharding(Collection<String> collection,
RangeShardingValue<Long> rangeShardingValue) {
// 逻辑表名
String logicTableName = rangeShardingValue.getLogicTableName();
// // 范围参数
Range<Long> valueRange = rangeShardingValue.getValueRange();
Set<String> queryRangeTables =
extracted(logicTableName,valueRange.lowerEndpoint(),valueRange.upperEndpoint());
ArrayList<String> tables = new ArrayList<>(collection);
tables.retainAll(queryRangeTables);
System.out.println(JSON.toJSONString(tables));
return tables;
}
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]