Re: With as syntax does not work in ignite 2.9.0?

2020-12-09 Thread Ilya Kasnacheev
Hello!

I don't think we can help you further without looking at some SQL
statements. You could probably try commercial support which you trust.

What's the connection string for your driver? Does it point to a server
node or client node?

Regards,
-- 
Ilya Kasnacheev


вт, 8 дек. 2020 г. в 09:17, yangjiajun <1371549...@qq.com>:

> Hello.Thanks for u reply.
>
> Sorry for that I can't post sqls beacuse they contain sensitive bussiness
> info.I'm also sorry that I can't make a reproducer now.
>
> Here is my code to execute query:
> ResultSet excuteQuery(Connection conn, String sql) throws SQLException {
> Statement stmt = conn.createStatement();
> stmt.setQueryTimeout(7200);
> ResultSet rs = stmt.executeQuery(sql);
> rs.setFetchSize(15000);
> return rs;
> }
>
> void closeResultSet(ResultSet rs) throws SQLException {
> rs.close();
> rs.getStatement().close();
> rs.getStatement().getConnection().close();
> }
>
> try(Connection conn = pool.getConnection()){
> try(ResultSet rs = excuteQuery(conn,sql)){
> /**
>  hadle result set
> */
> closeResultSet(rs);
> }
> }
>
> My hikariCP pool settings:
> HikariDataSource ds = new HikariDataSource();
> ds.setDriverClassName("org.apache.ignite.IgniteJdbcThinDriver");
> ds.setMaximumPoolSize(100);
> ds.setLeakDetectionThreshold(60);
> ds.setConnectionTimeout(6);
> ds.setMinimumIdle(0);
> ds.setReadOnly(true);
>
> The reseason I believe with as syntax does not work anymore is I have 5
> sqls
> got in trouble and all of then contain with as syntax.Another reason is
> such
> error happens at parse step.And we can see error info relates to 'temp
> table' which I think with as needs temp table.
>
> But u guys are experts,I will try my best to follow u advices and collect
> more info u need.
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: With as syntax does not work in ignite 2.9.0?

2020-12-07 Thread yangjiajun
Hello.Thanks for u reply.

Sorry for that I can't post sqls beacuse they contain sensitive bussiness
info.I'm also sorry that I can't make a reproducer now.

Here is my code to execute query:
ResultSet excuteQuery(Connection conn, String sql) throws SQLException {
Statement stmt = conn.createStatement();
stmt.setQueryTimeout(7200);
ResultSet rs = stmt.executeQuery(sql);
rs.setFetchSize(15000);
return rs;
}

void closeResultSet(ResultSet rs) throws SQLException {
rs.close();
rs.getStatement().close();
rs.getStatement().getConnection().close();
}

try(Connection conn = pool.getConnection()){
try(ResultSet rs = excuteQuery(conn,sql)){
/**
 hadle result set
*/
closeResultSet(rs);
}
}

My hikariCP pool settings:
HikariDataSource ds = new HikariDataSource();
ds.setDriverClassName("org.apache.ignite.IgniteJdbcThinDriver");
ds.setMaximumPoolSize(100);
ds.setLeakDetectionThreshold(60);
ds.setConnectionTimeout(6);
ds.setMinimumIdle(0);
ds.setReadOnly(true);

The reseason I believe with as syntax does not work anymore is I have 5 sqls
got in trouble and all of then contain with as syntax.Another reason is such
error happens at parse step.And we can see error info relates to 'temp
table' which I think with as needs temp table.

But u guys are experts,I will try my best to follow u advices and collect
more info u need.






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: With as syntax does not work in ignite 2.9.0?

2020-12-07 Thread Ilya Kasnacheev
Hello!

Do you happen to run this query on client or server node? Try running it on
a server node for a chance. Clients initialize cached lazily and yield a
crop of NPEs.

Regards,
-- 
Ilya Kasnacheev


пн, 7 дек. 2020 г. в 05:40, yangjiajun <1371549...@qq.com>:

> Hello.
>
> We use 'with xxx as  (select xxx) ',which works vrey fine in 2.8.1 and
> other
> past release versions.After we uprade to 2.9.0,such sqls start to throw
> exception. In the server side,the error looks like:
>
> , args=Object[] [], stmtType=SELECT_STATEMENT_TYPE, autoCommit=true,
> partResReq=false, super=JdbcRequest [type=2, reqId=790418]]]
> class org.apache.ignite.internal.processors.query.IgniteSQLException:
> Failed
> to parse query. General error: "java.lang.NullPointerException" [5-197]
> at
>
> org.apache.ignite.internal.processors.query.h2.H2Connection.prepareStatementNoCache(H2Connection.java:194)
> at
>
> org.apache.ignite.internal.processors.query.h2.H2PooledConnection.prepareStatementNoCache(H2PooledConnection.java:109)
> at
>
> org.apache.ignite.internal.processors.query.h2.QueryParser.parseH2(QueryParser.java:355)
> at
>
> org.apache.ignite.internal.processors.query.h2.QueryParser.parse0(QueryParser.java:222)
> at
>
> org.apache.ignite.internal.processors.query.h2.QueryParser.parse(QueryParser.java:138)
> at
>
> org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1071)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2779)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2775)
> at
>
> org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:3338)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$2(GridQueryProcessor.java:2795)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2833)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2769)
> at
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2727)
> at
>
> org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:647)
> at
>
> org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.doHandle(JdbcRequestHandler.java:320)
> at
>
> org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:257)
> at
>
> org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:202)
> at
>
> org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:56)
> at
>
> org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
> at
>
> org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
> at
>
> org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
> at
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
> at
>
> org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
> 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:745)
> Caused by: org.h2.jdbc.JdbcSQLException: General error:
> "java.lang.NullPointerException" [5-197]
> at
> org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
> at org.h2.message.DbException.get(DbException.java:168)
> at org.h2.message.DbException.convert(DbException.java:307)
> at org.h2.message.DbException.toSQLException(DbException.java:280)
> at org.h2.message.TraceObject.logAndConvert(TraceObject.java:357)
> at
> org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:697)
> at
>
> org.apache.ignite.internal.processors.query.h2.H2Connection.prepareStatementNoCache(H2Connection.java:191)
> ... 26 more
> Caused by: java.lang.NullPointerException
> at org.h2.table.Table.removeChildrenAndResources(Table.java:545)
> at
> org.h2.table.TableView.removeChildrenAndResources(TableView.java:439)
> at org.h2.engine.Session.removeLocalTempTable(Session.java:409)
> at
> org.h2.command.Parser.parseSingleCommonTableExpression(Parser.java:5233)
> at 

Re: With as syntax does not work in ignite 2.9.0?

2020-12-07 Thread Pavel Vinokurov
Hi,

Could you show the query and the code block with the query execution
because query "with p as (select * from person) select * from p" works well
on 2.9.0.
I suspect that the issue could be related to creating jdbc resources.
Could you also show the configuration for the hikari jdbc pool.

Thanks,
Pavel

пн, 7 дек. 2020 г. в 12:43, Alexandr Shapkin :

> Hi,
>
>
>
> I’ve filed a JIRA ticket
> https://issues.apache.org/jira/browse/IGNITE-13822 to track this issue.
>
> Full logs or a simple reproducer would help to debug this more quickly,
> feel free to share them as well.
>
>
>
> *From: *yangjiajun <1371549...@qq.com>
> *Sent: *Monday, December 7, 2020 5:40 AM
> *To: *user@ignite.apache.org
> *Subject: *With as syntax does not work in ignite 2.9.0?
>
>
>
> Hello.
>
>
>
> We use 'with xxx as  (select xxx) ',which works vrey fine in 2.8.1 and
> other
>
> past release versions.After we uprade to 2.9.0,such sqls start to throw
>
> exception. In the server side,the error looks like:
>
>
>
> , args=Object[] [], stmtType=SELECT_STATEMENT_TYPE, autoCommit=true,
>
> partResReq=false, super=JdbcRequest [type=2, reqId=790418]]]
>
> class org.apache.ignite.internal.processors.query.IgniteSQLException:
> Failed
>
> to parse query. General error: "java.lang.NullPointerException" [5-197]
>
>   at
>
>
> org.apache.ignite.internal.processors.query.h2.H2Connection.prepareStatementNoCache(H2Connection.java:194)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.h2.H2PooledConnection.prepareStatementNoCache(H2PooledConnection.java:109)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.h2.QueryParser.parseH2(QueryParser.java:355)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.h2.QueryParser.parse0(QueryParser.java:222)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.h2.QueryParser.parse(QueryParser.java:138)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1071)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2779)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2775)
>
>   at
>
>
> org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:3338)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$2(GridQueryProcessor.java:2795)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2833)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2769)
>
>   at
>
>
> org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2727)
>
>   at
>
>
> org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:647)
>
>   at
>
>
> org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.doHandle(JdbcRequestHandler.java:320)
>
>   at
>
>
> org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:257)
>
>   at
>
>
> org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:202)
>
>   at
>
>
> org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:56)
>
>   at
>
>
> org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
>
>   at
>
>
> org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
>
>   at
>
>
> org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
>
>   at
>
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
>
>   at
>
>
> org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
>
>   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:745)
>
> Caused by: org.h2.jdbc.JdbcSQLException: General error:
>
> "java.lang.NullPointerException" [5-197]
>
>   at
> org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
>
>   at org.h2.message.DbException.get(DbException.java:168)
>
>   at 

RE: With as syntax does not work in ignite 2.9.0?

2020-12-07 Thread Alexandr Shapkin
Hi, I’ve filed a JIRA ticket https://issues.apache.org/jira/browse/IGNITE-13822 to track this issue.Full logs or a simple reproducer would help to debug this more quickly, feel free to share them as well. From: yangjiajunSent: Monday, December 7, 2020 5:40 AMTo: user@ignite.apache.orgSubject: With as syntax does not work in ignite 2.9.0? Hello. We use 'with xxx as  (select xxx) ',which works vrey fine in 2.8.1 and otherpast release versions.After we uprade to 2.9.0,such sqls start to throwexception. In the server side,the error looks like: , args=Object[] [], stmtType=SELECT_STATEMENT_TYPE, autoCommit=true,partResReq=false, super=JdbcRequest [type=2, reqId=790418]]]class org.apache.ignite.internal.processors.query.IgniteSQLException: Failedto parse query. General error: "java.lang.NullPointerException" [5-197]  atorg.apache.ignite.internal.processors.query.h2.H2Connection.prepareStatementNoCache(H2Connection.java:194)  atorg.apache.ignite.internal.processors.query.h2.H2PooledConnection.prepareStatementNoCache(H2PooledConnection.java:109)  atorg.apache.ignite.internal.processors.query.h2.QueryParser.parseH2(QueryParser.java:355)  atorg.apache.ignite.internal.processors.query.h2.QueryParser.parse0(QueryParser.java:222)  atorg.apache.ignite.internal.processors.query.h2.QueryParser.parse(QueryParser.java:138)  atorg.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1071)  atorg.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2779)  atorg.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2775)  atorg.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)  atorg.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:3338)  atorg.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$2(GridQueryProcessor.java:2795)  atorg.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2833)  atorg.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2769)  atorg.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2727)  atorg.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:647)  atorg.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.doHandle(JdbcRequestHandler.java:320)  atorg.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:257)  atorg.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:202)  atorg.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:56)  atorg.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)  atorg.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)  atorg.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)  atorg.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)  atorg.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)  atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  at java.lang.Thread.run(Thread.java:745)Caused by: org.h2.jdbc.JdbcSQLException: General error:"java.lang.NullPointerException" [5-197]  at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)  at org.h2.message.DbException.get(DbException.java:168)  at org.h2.message.DbException.convert(DbException.java:307)  at org.h2.message.DbException.toSQLException(DbException.java:280)  at org.h2.message.TraceObject.logAndConvert(TraceObject.java:357)  at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:697)  atorg.apache.ignite.internal.processors.query.h2.H2Connection.prepareStatementNoCache(H2Connection.java:191)  ... 26 moreCaused by: java.lang.NullPointerException  at org.h2.table.Table.removeChildrenAndResources(Table.java:545)  at org.h2.table.TableView.removeChildrenAndResources(TableView.java:439)  at org.h2.engine.Session.removeLocalTempTable(Session.java:409)  at org.h2.command.Parser.parseSingleCommonTableExpression(Parser.java:5233)