Hi Team,
Please ignore previous mail which is incomplete.

I am using apache calcite to access data from different databases and execute 
my queries.

I have tried to query a database with large data with the following model.json

inline: {
  version: '1.0',
  defaultSchema: 'Mango',
  schemas: [
    {
        name: 'Mango',
        type: 'custom',
        factory: 'org.apache.calcite.adapter.jdbc.JdbcSchema$Factory',
        operand: {
            jdbcDriver: 'com.mysql.jdbc.Driver',
            jdbcUrl: 'jdbc:mysql://192.168.2.9:3306/mango',
            jdbcUser: 'devuser',
            jdbcPassword: 'devuser'
        }
    }
  ]
}


When I try to access a table with nearly 100000 rows in it, I am getting 
Timeout Exception.

Here is the stack-trace. 



Caused by: java.sql.SQLException: Error while executing SQL "select 
Mango.pointvalues.dataType as pointvalues_dataType 
from
Mango.pointvalues 
limit 1000": while executing SQL [SELECT `dataType`
FROM `pointvalues`]
at org.apache.calcite.avatica.Helper.createException(Helper.java:52)
at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
at 
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:143)
at 
org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:186)
at com.helical.efwd.jdbc.JdbcDaoImpl.query(JdbcDaoImpl.java:36)
... 93 more
Caused by: java.lang.RuntimeException: while executing SQL [SELECT `dataType`
FROM `pointvalues`]
at 
org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:149)
at 
org.apache.calcite.linq4j.EnumerableDefaults$24.enumerator(EnumerableDefaults.java:2382)
at 
org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:77)
at 
org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:190)
at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:65)
at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
at 
org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:566)
at 
org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:578)
at 
org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:571)
at 
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:136)
... 95 more
Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled 
due to timeout or client request
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2730)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)
at 
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at 
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at 
org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:144)
... 105 more


How do I solve this issue? Where to find related documentation so that I can 
solve the issue?

Thanks in advance.

Rajasekhar

Reply via email to