AnsweredAssumed Answered

JDBC PreparedStatement is failing with Apache Drill

Question asked by kunalpal on Mar 15, 2017
Latest reply on Mar 21, 2017 by maprcommunity

I'm trying to query Drill (version: 1.9) using JDBC. I've tried to use PreparedStatement for querying data, but I'm getting the following exception:

 

SQL state [null]; error code [0]; Failed to create prepared statement: PLAN ERROR: Cannot convert RexNode to equivalent Drill expression. RexNode Class: org.apache.calcite.rex.RexDynamicParam, RexNode Digest: ?0

My parameterized query is as follows:

SELECT * FROM cp.`employee.json` WHERE first_name = ? LIMIT 20

 

On checking "Apache Drill Profile" at <mapr_node>:8047/profiles , I found that the following query has fired 

SELECT * ( SELECT * FROM cp.`employee.json` WHERE first_name = ? ) LIMIT 0

 

resulting in following error:

PLAN ERROR: Cannot convert RexNode to equivalent Drill expression. RexNode Class: org.apache.calcite.rex.RexDynamicParam, RexNode Digest: ?0

 

Please help in in doing parameterized query to Drill using PreparedStatement 

 

Outcomes