You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:29:57 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue #10760: ClassCastException occur when execute select statament that include timestamp field with calcite

strongduanmu opened a new issue #10760:
URL: https://github.com/apache/shardingsphere/issues/10760


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   master branch
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   sharding-jdbc
   
   ### Expected behavior
   
   execute select statament that include timestamp field success with calcite
   
   ### Actual behavior
   
   throw exception
   
   ![image](https://user-images.githubusercontent.com/10829171/121649089-c909cf80-caca-11eb-9d2e-9f6d4aefbcfd.png)
   
   ### 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu edited a comment on issue #10760: ClassCastException occur when execute select statament that include timestamp field with calcite

Posted by GitBox <gi...@apache.org>.
strongduanmu edited a comment on issue #10760:
URL: https://github.com/apache/shardingsphere/issues/10760#issuecomment-917971039


   Exception stack info.
   
   ```
   [ERROR] 2021-09-13 16:41:42.567 [Connection-2-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.lang.Number
   	at org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:722)
   	at org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getTimestamp(AbstractCursor.java:996)
   	at org.apache.calcite.avatica.AvaticaSite.get(AvaticaSite.java:372)
   	at org.apache.calcite.avatica.AvaticaResultSet.getObject(AvaticaResultSet.java:393)
   	at org.apache.shardingsphere.infra.executor.sql.execute.result.query.impl.driver.jdbc.type.stream.JDBCStreamQueryResult.getValue(JDBCStreamQueryResult.java:87)
   	at org.apache.shardingsphere.infra.merge.result.impl.stream.StreamMergedResult.getValue(StreamMergedResult.java:47)
   	at org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.getQueryResponseRow(DatabaseCommunicationEngine.java:210)
   	at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.getRowData(SchemaAssignedDatabaseBackendHandler.java:65)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.getQueryRowPacket(PostgreSQLComQueryExecutor.java:110)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.getQueryRowPacket(PostgreSQLComQueryExecutor.java:54)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.writeDataPackets(PostgreSQLCommandExecuteEngine.java:120)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.processSimpleQuery(PostgreSQLCommandExecuteEngine.java:102)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.writeQueryData(PostgreSQLCommandExecuteEngine.java:91)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:105)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   	at java.lang.Thread.run(Thread.java:748)
   ```


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #10760: ClassCastException occur when execute select statament that include timestamp field with calcite

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10760:
URL: https://github.com/apache/shardingsphere/issues/10760#issuecomment-859399890


   Because this exception is a problem with [calcite](https://issues.apache.org/jira/browse/CALCITE-3018), the quick solution is to adjust the routing rules of the same database table first, and then find a solution to solve this issue.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero closed issue #10760: ClassCastException occur when execute select statament that include timestamp field with calcite

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #10760:
URL: https://github.com/apache/shardingsphere/issues/10760


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #10760: ClassCastException occur when execute select statament that include timestamp field with calcite

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10760:
URL: https://github.com/apache/shardingsphere/issues/10760#issuecomment-917971039


   ```
   [ERROR] 2021-09-13 16:41:42.567 [Connection-2-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.lang.Number
   	at org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:722)
   	at org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getTimestamp(AbstractCursor.java:996)
   	at org.apache.calcite.avatica.AvaticaSite.get(AvaticaSite.java:372)
   	at org.apache.calcite.avatica.AvaticaResultSet.getObject(AvaticaResultSet.java:393)
   	at org.apache.shardingsphere.infra.executor.sql.execute.result.query.impl.driver.jdbc.type.stream.JDBCStreamQueryResult.getValue(JDBCStreamQueryResult.java:87)
   	at org.apache.shardingsphere.infra.merge.result.impl.stream.StreamMergedResult.getValue(StreamMergedResult.java:47)
   	at org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.getQueryResponseRow(DatabaseCommunicationEngine.java:210)
   	at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.getRowData(SchemaAssignedDatabaseBackendHandler.java:65)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.getQueryRowPacket(PostgreSQLComQueryExecutor.java:110)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.getQueryRowPacket(PostgreSQLComQueryExecutor.java:54)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.writeDataPackets(PostgreSQLCommandExecuteEngine.java:120)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.processSimpleQuery(PostgreSQLCommandExecuteEngine.java:102)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.writeQueryData(PostgreSQLCommandExecuteEngine.java:91)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:105)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   	at java.lang.Thread.run(Thread.java:748)
   ```


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org