kar1rose opened a new issue #12286:
URL: https://github.com/apache/shardingsphere/issues/12286
## Question
when I use join query with two databases, it will throw this error
`String sql = "select * from t_user t join p_order p on t.id = p.user_id ";
while (rs.next()) {
for (int i = 1; i <= count; i++) {
System.out.print(rs.getObject(i));
if (i != count) {
System.out.print("|");
}
}
System.out.println();
}
`
`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.driver.jdbc.core.resultset.ShardingSphereResultSet.getObject(ShardingSphereResultSet.java:359)`
it will cast timestamp to Number and error, if I just use single table query
,it's ok like this
'String sql = "select * from t_user t ";'
--
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]