dengxiaolin23 opened a new issue, #28951:
URL: https://github.com/apache/shardingsphere/issues/28951

   1. Configure config shadow. yaml as follows:
   databaseName: shadow_db
   
   dataSources:
     db_mblog:
       url: 
jdbc:mysql://192.168.0.189:3306/db_mblog?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_db_mblog:
       url: 
jdbc:mysql://192.168.0.189:3306/db_mblog?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
   
   rules:
   - !SHADOW
     dataSources:
       shadowDataSource:
         productionDataSourceName: db_mblog
         shadowDataSourceName: ds_db_mblog
     shadowAlgorithms:
       sql_hint_algorithm:
         type: SQL_HINT
         props:
           cyborg-flow: true
   2. Configure my APP's config as  follows:
    url: 
jdbc:mysql://192.168.0.189:3307/shadow_db?useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2B8
   
   3.start app.
   
   4.start app failed and report an error as follows:
   [ERROR] 2023-11-03 18:08:08.843 [ShardingSphere-Command-2] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   java.lang.ClassCastException: org.apache.calcite.rex.RexSubQuery cannot be 
cast to org.apache.calcite.rex.RexLocalRef
           at 
org.apache.calcite.rex.RexProgramBuilder.registerInput(RexProgramBuilder.java:304)
           at 
org.apache.calcite.rex.RexProgramBuilder.addProject(RexProgramBuilder.java:213)
           at org.apache.calcite.rex.RexProgram.create(RexProgram.java:235)
           at org.apache.calcite.rex.RexProgram.create(RexProgram.java:204)
           at 
org.apache.calcite.rel.rules.ProjectToCalcRule.onMatch(ProjectToCalcRule.java:65)
           at 
org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:337)
           at 
org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:556)
           at 
org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:420)
           at 
org.apache.calcite.plan.hep.HepPlanner.executeEndGroup(HepPlanner.java:360)
           at 
org.apache.calcite.plan.hep.HepInstruction$EndGroup$State.execute(HepInstruction.java:349)
           at 
org.apache.calcite.plan.hep.HepPlanner.lambda$executeProgram$0(HepPlanner.java:211)
           at 
com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
           at 
org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:210)
           at 
org.apache.calcite.plan.hep.HepProgram$State.execute(HepProgram.java:118)
           at 
org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:205)
           at 
org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:191)
           at 
org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompiler.rewrite(SQLStatementCompiler.java:66)
           at 
org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompiler.compile(SQLStatementCompiler.java:58)
           at 
org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompilerEngine.compile(SQLStatementCompilerEngine.java:45)
           at 
org.apache.shardingsphere.sqlfederation.compiler.SQLFederationCompilerEngine.compile(SQLFederationCompilerEngine.java:44)
           at 
org.apache.shardingsphere.sqlfederation.engine.SQLFederationEngine.compileQuery(SQLFederationEngine.java:182)
           at 
org.apache.shardingsphere.sqlfederation.engine.SQLFederationEngine.executeQuery(SQLFederationEngine.java:158)
           at 
org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.doExecuteFederation(DatabaseConnector.java:246)
           at 
org.apache.shardingsphere.proxy.backend.connector.DatabaseConnector.execute(DatabaseConnector.java:165)
           at 
org.apache.shardingsphere.proxy.backend.handler.data.impl.UnicastDatabaseBackendHandler.execute(UnicastDatabaseBackendHandler.java:62)
           at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:99)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:126)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:121)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
           at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
           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:750)
   
   
   


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

Reply via email to