<p dir="auto">[ERROR] 2021-12-11 18:18:37.516 [ShardingSphere-Command-0] o.a.s.p.f.c.CommandExecutorTask - Exception occur:<br>
java.sql.SQLException: exception while executing query: java.math.BigInteger cannot be cast to java.lang.Long<br>
at org.apache.calcite.avatica.Helper.createException(Helper.java:56)<br>
at org.apache.calcite.avatica.Helper.createException(Helper.java:41)<br>
at org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:577)<br>
at org.apache.calcite.avatica.AvaticaPreparedStatement.executeQuery(AvaticaPreparedStatement.java:137)<br>
at org.apache.shardingsphere.infra.executor.sql.federate.original.OriginalFilterableExecutor.execute(OriginalFilterableExecutor.java:87)<br>
at org.apache.shardingsphere.infra.executor.sql.federate.original.OriginalFilterableExecutor.executeQuery(OriginalFilterableExecutor.java:77)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.federateExecute(ProxySQLExecutor.java:164)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:136)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:127)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.doExecute(ProxyLockEngine.java:103)<br>
at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.execute(ProxyLockEngine.java:81)<br>
at org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.execute(DatabaseCommunicationEngine.java:126)<br>
at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.execute(SchemaAssignedDatabaseBackendHandler.java:55)<br>
at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:61)<br>
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:99)<br>
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)<br>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)<br>
at java.lang.Thread.run(Thread.java:748)<br>
Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long<br>
at Baz$2.apply(Unknown Source)<br>
at Baz$2.apply(Unknown Source)<br>
at org.apache.calcite.linq4j.EnumerableDefaults.toLookup_(EnumerableDefaults.java:3604)<br>
at org.apache.calcite.linq4j.EnumerableDefaults.toLookup(EnumerableDefaults.java:3594)<br>
at org.apache.calcite.linq4j.EnumerableDefaults.toLookup(EnumerableDefaults.java:3570)<br>
at org.apache.calcite.linq4j.DefaultEnumerable.toLookup(DefaultEnumerable.java:748)<br>
at org.apache.calcite.linq4j.EnumerableDefaults$6.enumerator(EnumerableDefaults.java:1316)<br>
at org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)<br>
at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:90)<br>
at org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:184)<br>
at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:64)<br>
at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:43)<br>
at org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:573)<br>
... 16 common frames omitted</p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>For English only</strong>, other languages will not accept.</p>
<p dir="auto">Before report a bug, make sure you have:</p>
<ul dir="auto">
<li>Searched open and closed <a href="https://github.com/sharding-sphere/sharding-sphere/issues">GitHub issues</a>.</li>
<li>Read documentation: <a href="http://shardingsphere.io/document/current/en/overview/" rel="nofollow">ShardingSphere Doc</a>.</li>
</ul>
<p dir="auto">Please pay attention on issues you submitted, because we maybe need more details.<br>
If no response <strong>more than 7 days</strong> and we cannot reproduce it on current information, we will <strong>close it</strong>.</p>
<p dir="auto">Please answer these questions before submitting your issue. Thanks!</p>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">3.1.0</p>
<h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3>
<p dir="auto">Sharding-JDBC</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">subquery can  work as expect</p>
<h3 dir="auto">Actual behavior</h3>
<h3 dir="auto">Reason analyze (If you can)</h3>
<p dir="auto"><a href="https://github.com/apache/incubator-shardingsphere/files/2864758/bug.txt">bug.txt</a></p>
<h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>