FAQ
Hi,

When running a query like:
EXPLAIN SELECT * FROM mytable
over the JDBC driver, calling ResultSet.next() returns false at the end of the abstract syntax tree, even though there are more rows to fetch.

So typical JDBC processing code of the form:
while (rs.next()) {
//process a row
}

stops before the end of the results.

Is this a known bug? If not I'll file a bug report for it.

Cheers,
Peter

PS Through trial and error (and a little stepping through the Hive driver with a debugger) I discovered you can process to the end of the ResultSet with code of the form:
while (true) {
if(!rs.next() && !rs.next()) {
break;
}
//process a row
}

I can't vouch for how cross database compatible this code is, but it seems to work OK for Hive and MySQL with my limited testing.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedNov 24, '10 at 5:07a
activeNov 24, '10 at 5:07a
posts1
users1
websitehive.apache.org

1 user in discussion

Peter Hall: 1 post

People

Translate

site design / logo © 2022 Grokbase