Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

avatar
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

avatar
New Contributor

Issue resolved. 

 

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

View solution in original post

1 REPLY 1

avatar
New Contributor

Issue resolved. 

 

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