Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

Impala JDBC : Issue while caching resultset when query has LIMIT constraint

SOLVED Go to solution

Impala JDBC : Issue while caching resultset when query has LIMIT constraint

New Contributor

Hi, 

 

Please help me in below issue..Same Issue exist with both Impala and HIVE jdbc 

 

If I add LIMIT constarint in the query then I am unable to populate cached rowset with resultset.

 

Example :

Select .. from .. where .. group by ..order by ..desc ( working fine).

Select .. from .. where .. group by ..order by ..  desc limit 10 ( giving error).

 

Below is the the stacktrace using impala :

 

java.lang.NullPointerException
at java.lang.String.<init>(String.java:154) ~[?:1.7.0_10]
at sun.jdbc.rowset.RowSetMetaDataImpl.setSchemaName(RowSetMetaDataImpl.java:269) ~[rowset.jar:?]
at sun.jdbc.rowset.CachedRowSet.initMetaData(CachedRowSet.java:680) ~[rowset.jar:?]
at sun.jdbc.rowset.CachedRowSet.populate(CachedRowSet.java:647) ~[rowset.jar:?]

 

Actual code snippet :

 

statement = dbConnection.createStatement();
resultSet = statement.executeQuery(query);
rowSet.populate(resultSet);

 

rowset is sun.jdbc.rowset.CachedRowSet

 

Impala JDBC vsersion is - 2.5.38.1058 GA

 

 

Thanks in advance.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Impala JDBC : Issue while caching resultset when query has LIMIT constraint

New Contributor

Issue resolved. 

 

Instead of sun.jdbc.rowset.CachedRowSet I have used javax.sql.rowset.CachedRowSet;

1 REPLY 1
Highlighted

Re: Impala JDBC : Issue while caching resultset when query has LIMIT constraint

New Contributor

Issue resolved. 

 

Instead of sun.jdbc.rowset.CachedRowSet I have used javax.sql.rowset.CachedRowSet;