方便更快捷的说明问题,可以按需填写(可删除)
使用环境:shardingjdbc5.3.2
mysql
场景、问题:
com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError: org.codehaus.commons.compiler.CompilerFactoryFactory.getDefaultCompilerFactory(Ljava/lang/ClassLoader;)Lorg/codehaus/commons/compiler/ICompilerFactory;
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4935)
at org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.revise(JaninoRelMetadataProvider.java:189)
at org.apache.calcite.rel.metadata.RelMetadataQueryBase.revise(RelMetadataQueryBase.java:118)
at org.apache.calcite.rel.metadata.RelMetadataQuery.collations(RelMetadataQuery.java:604)
at org.apache.calcite.rel.metadata.RelMdCollation.project(RelMdCollation.java:291)
at org.apache.calcite.rel.logical.LogicalProject.lambda$create$0(LogicalProject.java:125)
at org.apache.calcite.plan.RelTraitSet.replaceIfs(RelTraitSet.java:244)
at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:124)
at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:114)
at org.apache.calcite.rel.core.RelFactories$ProjectFactoryImpl.createProject(RelFactories.java:178)
at org.apache.calcite.tools.RelBuilder.project_(RelBuilder.java:2043)
at org.apache.calcite.tools.RelBuilder.project(RelBuilder.java:1820)
at org.apache.calcite.tools.RelBuilder.project(RelBuilder.java:1792)
已进行操作:
dataSources:
db_505:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username:
password:
db_506:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/webzp?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username:
password:
rules:
-
!SHARDING
tables:
t_user:
actualDataNodes: db_${505…506}.t_user
databaseStrategy:
standard:
shardingColumn: user_id
shardingAlgorithmName: t_order_item_inlineshardingAlgorithms:
t_order_item_inline:
type: INLINE
props:
algorithm-expression: db_${user_id.substring(0,3)}
props:
sql-show: true
sql-federation-type: ADVANCED
现状:
@Select({“SELECT * from t_order o left join t_user u on o.user_id = u.user_id”,
" where o.user_id = #{id}"})
List getUserAmount(String id);