关于表分片的设计

方便更快捷的说明问题,可以按需填写(可删除)

版本为:5.3.2

场景、问题:

现在我有4张表,其中order表按照时间进行分割成多个按年的分表放到不同的库里,
然后其余的三张表关联表,是通过order表关联出来进行划分的,本质是依托order的时间分割,但是三张表本身没有带order的时间
现在我不知道要怎么对三张表做分片处理比较好?看了文档可以依托Hint?
然后其他的分库是没有其他的业务表的,只有年分表,那四张表,现有库才有单表
然后我设置了sql-federation-type: ADVANCED
还是不能跨库查询分库的三张表的关联查询,此时我只设置了order表的分片,其他的三张表没有做任何处理

我咨询的是三张表应该怎么分片,然后跨库查询失败的原因

[ERROR] 2023-04-19 11:07:55.407 [Connection-2-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
java.lang.IllegalStateException: null
	at java.util.Optional.orElseThrow(Optional.java:290)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.BinaryOperationExpressionConverter.convertSqlNodes(BinaryOperationExpressionConverter.java:88)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.BinaryOperationExpressionConverter.convert(BinaryOperationExpressionConverter.java:82)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter.convert(ExpressionConverter.java:75)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.where.WhereConverter.convert(WhereConverter.java:34)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter.lambda$convertSelect$3(SelectStatementConverter.java:67)
	at java.util.Optional.flatMap(Optional.java:241)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter.convertSelect(SelectStatementConverter.java:67)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter.convert(SelectStatementConverter.java:51)
	at org.apache.shardingsphere.sqlfederation.optimizer.converter.SQLNodeConverterEngine.convert(SQLNodeConverterEngine.java:42)
	at org.apache.shardingsphere.sqlfederation.optimizer.SQLOptimizeEngine.optimize(SQLOptimizeEngine.java:49)
	at org.apache.shardingsphere.sqlfederation.advanced.AdvancedSQLFederationExecutor.execute(AdvancedSQLFederationExecutor.java:146)
	at org.apache.shardingsphere.sqlfederation.advanced.AdvancedSQLFederationExecutor.executeQuery(AdvancedSQLFederationExecutor.java:114)
	at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.doExecuteFederation(DatabaseConnector.java:288)
	at org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.execute(DatabaseConnector.java:205)
	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:92)
	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:114)
	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:109)
	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:77)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
京ICP备2021015875号