* row to fetch or numRows == 0.
* @throws HiveServerException Invalid value for numRows (numRows < 0)
*/
public List<String> fetchN(int numRows) throws HiveServerException, TException {
if (numRows < 0) {
throw new HiveServerException("Invalid argument for number of rows: " + numRows);
}
if (!isHiveQuery)
// Return no results if the last command was not a Hive query
return new Vector<String>();
Vector<String> result = new Vector<String>();
driver.setMaxRows(numRows);
try {
driver.getResults(result);
} catch (IOException e) {
throw new HiveServerException(e.getMessage());
}
return result;
}