[ https://issues.apache.org/jira/browse/DRILL-6816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16690157#comment-16690157 ]
Khurram Faraaz commented on DRILL-6816: --------------------------------------- [~vitalii] I haven't tried with executeQuery method yet, I will run the test using executeQuery and share results here. > NPE - Concurrent query execution using PreparedStatement > --------------------------------------------------------- > > Key: DRILL-6816 > URL: https://issues.apache.org/jira/browse/DRILL-6816 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.14.0 > Reporter: Khurram Faraaz > Priority: Major > Attachments: test_tbl.json > > > Concurrent query execution from JDBC program using PreparedStatement results > in NPE. > Queries that were executed concurrently are (part of a query file), > {noformat} > select id from `test_tbl.json` > select count(id) from `test_tbl.json` > select count(*) from `test_tbl.json` > select * from `test_tbl.json` > {noformat} > Drill 1.14.0 > git.commit.id=35a1ae23c9b280b9e73cb0f6f01808c996515454 > MapR version => 6.1.0.20180911143226.GA (secure cluster) > JDBC driver used was org.apache.drill.jdbc.Driver > Executing the above queries concurrently using a Statement object results in > successful query execution. > {noformat} > Statement stmt = conn.createStatement(); > ResultSet rs = stmt.executeQuery(query); > {noformat} > However, when the same queries listed above are executed using a > PreparedStatement object we see an NPE > {noformat} > PreparedStatement prdstmnt = conn.prepareStatement(query); > prdstmnt.executeUpdate(); > {noformat} > Stack trace from drillbit.log > {noformat} > 17:04:32.941 [pool-1-thread-3] DEBUG o.a.d.j.impl.DrillStatementRegistry - > Adding to open-statements registry: > org.apache.drill.jdbc.impl.DrillJdbc41Factory$DrillJdbc41PreparedStatement@35757005 > 17:04:32.941 [pool-1-thread-2] DEBUG o.a.d.j.impl.DrillStatementRegistry - > Adding to open-statements registry: > org.apache.drill.jdbc.impl.DrillJdbc41Factory$DrillJdbc41PreparedStatement@d4413b8 > 17:04:32.956 [pool-1-thread-1] DEBUG o.a.d.j.impl.DrillStatementRegistry - > Adding to open-statements registry: > org.apache.drill.jdbc.impl.DrillJdbc41Factory$DrillJdbc41PreparedStatement@5eb3b9ab > 17:04:32.956 [pool-1-thread-4] DEBUG o.a.d.j.impl.DrillStatementRegistry - > Adding to open-statements registry: > org.apache.drill.jdbc.impl.DrillJdbc41Factory$DrillJdbc41PreparedStatement@d9367d0 > java.lang.NullPointerException > at java.util.Objects.requireNonNull(Objects.java:203) > at org.apache.calcite.avatica.Meta$MetaResultSet.create(Meta.java:577) > at org.apache.drill.jdbc.impl.DrillMetaImpl.execute(DrillMetaImpl.java:1143) > at org.apache.drill.jdbc.impl.DrillMetaImpl.execute(DrillMetaImpl.java:1150) > at > org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:511) > at > org.apache.calcite.avatica.AvaticaPreparedStatement.executeLargeUpdate(AvaticaPreparedStatement.java:146) > at > org.apache.drill.jdbc.impl.DrillPreparedStatementImpl.executeLargeUpdate(DrillPreparedStatementImpl.java:512) > at > org.apache.calcite.avatica.AvaticaPreparedStatement.executeUpdate(AvaticaPreparedStatement.java:142) > at RunQuery.executeQuery(RunQuery.java:61) > at RunQuery.run(RunQuery.java:30) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748) > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)