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

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.2.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   select successfully
   ```sql
   select * from t_accounts where id in (select max(id) from t_accounts group 
by project_id);
   ```
   
   ### Actual behavior
   ```java
   [ERROR] 2022-10-31 09:34:26.811 [Connection-1-ThreadExecutor] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.sql.SQLException: exception while executing query: class 
java.math.BigInteger cannot be cast to class java.lang.Long 
(java.math.BigInteger and java.lang.Long are in module java.base of loader 
'bootstrap')
        at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
        at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
        at 
org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:579)
        at 
org.apache.calcite.avatica.AvaticaPreparedStatement.executeQuery(AvaticaPreparedStatement.java:137)
        at 
org.apache.shardingsphere.infra.federation.executor.original.OriginalFederationExecutor.executeQuery(OriginalFederationExecutor.java:87)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.doExecuteFederation(JDBCDatabaseCommunicationEngine.java:165)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:123)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:94)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:110)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:77)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
   Caused by: java.lang.ClassCastException: class java.math.BigInteger cannot 
be cast to class java.lang.Long (java.math.BigInteger and java.lang.Long are in 
module java.base of loader 'bootstrap')
        at Baz$4.apply(Unknown Source)
        at Baz$4.apply(Unknown Source)
        at 
org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:981)
        at 
org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:781)
        at 
org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:311)
        at Baz.bind(Unknown Source)
        at 
org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(CalcitePrepare.java:363)
        at 
org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(CalciteConnectionImpl.java:323)
        at 
org.apache.calcite.jdbc.CalciteMetaImpl._createIterable(CalciteMetaImpl.java:578)
        at 
org.apache.calcite.jdbc.CalciteMetaImpl.createIterable(CalciteMetaImpl.java:569)
        at 
org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:184)
        at 
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:64)
        at 
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:43)
        at 
org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:575)
        ... 10 common frames omitted
   
   ```
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


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