else if ("42000".equals(sqlState)) {
return new BadSqlGrammarException("Hive query", "", new SQLException(cause, sqlState));
}
// not found/already exists
else if ("42S02".equals(sqlState)) {
return new InvalidDataAccessResourceUsageException(cause, ex);
}
// invalid argument
else if ("21000".equals(sqlState)) {
return new BadSqlGrammarException("Hive query", "", new SQLException(cause, sqlState));
}
// use the new Hive 0.10 codes
// https://issues.apache.org/jira/browse/HIVE-3001
// semantic analysis
if (err >= 10000 && err <= 19999) {
return new InvalidDataAccessResourceUsageException(cause, ex);
}
// non transient runtime errors
else if (err >= 20000 && err <= 29999) {
return new DataRetrievalFailureException(cause, ex);