use of org.apache.hive.service.rpc.thrift.TStatus in project hive by apache.
the class TestHiveSQLException method testHiveSQLExceptionToTStatus.
/**
* Tests the conversion from a HiveSQLException exception to the TStatus object
*/
@Test
public void testHiveSQLExceptionToTStatus() {
String expectedMessage = "reason";
String expectedSqlState = "sqlState";
int expectedVendorCode = 10;
Exception ex1 = new HiveSQLException(expectedMessage, expectedSqlState, expectedVendorCode, createSimpleCause());
TStatus status = HiveSQLException.toTStatus(ex1);
Assert.assertEquals(TStatusCode.ERROR_STATUS, status.getStatusCode());
Assert.assertEquals(expectedSqlState, status.getSqlState());
Assert.assertEquals(expectedMessage, status.getErrorMessage());
Assert.assertEquals(HiveSQLException.toString(ex1), status.getInfoMessages());
}
Aggregations