strongduanmu edited a comment on issue #14827:
URL: 
https://github.com/apache/shardingsphere/issues/14827#issuecomment-1014299889


   After I added the `setFetchSize` logic to the JDBC adaptor, the same 
streaming query exception appeared.
   
   ```
   Exception in thread "main" java.sql.SQLException: exception while executing 
query: java.sql.SQLException: Streaming result set 
com.mysql.jdbc.RowDataDynamic@7433ca19 is still active. No statements may be 
issued when any streaming result sets are open and in use on a given 
connection. Ensure that you have called .close() on any active streaming result 
sets before attempting more queries.
        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:577)
        at 
org.apache.calcite.avatica.AvaticaPreparedStatement.executeQuery(AvaticaPreparedStatement.java:137)
        at 
org.apache.shardingsphere.infra.federation.executor.original.OriginalFilterableExecutor.executeQuery(OriginalFilterableExecutor.java:80)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeFederationQuery(ShardingSpherePreparedStatement.java:252)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:334)
        at 
com.strongduanmu.jdbc.MySQLShardingJDBCTest.execute(MySQLShardingJDBCTest.java:46)
        at 
com.strongduanmu.jdbc.MySQLShardingJDBCTest.main(MySQLShardingJDBCTest.java:31)
   Caused by: 
org.apache.shardingsphere.infra.exception.ShardingSphereException: 
java.sql.SQLException: Streaming result set 
com.mysql.jdbc.RowDataDynamic@7433ca19 is still active. No statements may be 
issued when any streaming result sets are open and in use on a given 
connection. Ensure that you have called .close() on any active streaming result 
sets before attempting more queries.
        at 
org.apache.shardingsphere.infra.federation.executor.original.table.FilterableTableScanExecutor.execute(FilterableTableScanExecutor.java:155)
        at 
org.apache.shardingsphere.infra.federation.executor.original.table.FilterableTable.scan(FilterableTable.java:53)
        at org.apache.calcite.schema.Schemas.enumerable(Schemas.java:249)
        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:333)
        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:182)
        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:573)
        ... 6 more
   Caused by: java.sql.SQLException: Streaming result set 
com.mysql.jdbc.RowDataDynamic@7433ca19 is still active. No statements may be 
issued when any streaming result sets are open and in use on a given 
connection. Ensure that you have called .close() on any active streaming result 
sets before attempting more queries.
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:869)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:865)
        at 
com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:3217)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2453)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
        at 
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
        at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011)
        at 
com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
        at 
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
        at 
org.apache.shardingsphere.driver.executor.callback.impl.PreparedStatementExecuteQueryCallback.executeQuery(PreparedStatementExecuteQueryCallback.java:40)
        at 
org.apache.shardingsphere.driver.executor.callback.ExecuteQueryCallback.executeSQL(ExecuteQueryCallback.java:44)
        at 
org.apache.shardingsphere.driver.executor.callback.ExecuteQueryCallback.executeSQL(ExecuteQueryCallback.java:36)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:85)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:64)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:101)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.parallelExecute(ExecutorEngine.java:97)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:82)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:65)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:49)
        at 
org.apache.shardingsphere.infra.federation.executor.original.table.FilterableTableScanExecutor.execute(FilterableTableScanExecutor.java:149)
        ... 17 more
   
   ```


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