use of org.apache.thrift.TException in project hive by apache.
the class HiveDatabaseMetaData method getTypeInfo.
public ResultSet getTypeInfo() throws SQLException {
TGetTypeInfoResp getTypeInfoResp;
TGetTypeInfoReq getTypeInfoReq = new TGetTypeInfoReq();
getTypeInfoReq.setSessionHandle(sessHandle);
try {
getTypeInfoResp = client.GetTypeInfo(getTypeInfoReq);
} catch (TException e) {
throw new SQLException(e.getMessage(), "08S01", e);
}
Utils.verifySuccess(getTypeInfoResp.getStatus());
return new HiveQueryResultSet.Builder(connection).setClient(client).setSessionHandle(sessHandle).setStmtHandle(getTypeInfoResp.getOperationHandle()).build();
}
use of org.apache.thrift.TException in project hive by apache.
the class HiveDatabaseMetaData method getCatalogs.
public ResultSet getCatalogs() throws SQLException {
TGetCatalogsResp catalogResp;
try {
catalogResp = client.GetCatalogs(new TGetCatalogsReq(sessHandle));
} catch (TException e) {
throw new SQLException(e.getMessage(), "08S01", e);
}
Utils.verifySuccess(catalogResp.getStatus());
return new HiveQueryResultSet.Builder(connection).setClient(client).setSessionHandle(sessHandle).setStmtHandle(catalogResp.getOperationHandle()).build();
}
use of org.apache.thrift.TException in project hive by apache.
the class HiveDatabaseMetaData method getCrossReference.
public ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException {
TGetCrossReferenceResp getFKResp;
TGetCrossReferenceReq getFKReq = new TGetCrossReferenceReq(sessHandle);
getFKReq.setParentTableName(primaryTable);
getFKReq.setParentSchemaName(primarySchema);
getFKReq.setParentCatalogName(primaryCatalog);
getFKReq.setForeignTableName(foreignTable);
getFKReq.setForeignSchemaName(foreignSchema);
getFKReq.setForeignCatalogName(foreignCatalog);
try {
getFKResp = client.GetCrossReference(getFKReq);
} catch (TException e) {
throw new SQLException(e.getMessage(), "08S01", e);
}
Utils.verifySuccess(getFKResp.getStatus());
return new HiveQueryResultSet.Builder(connection).setClient(client).setSessionHandle(sessHandle).setStmtHandle(getFKResp.getOperationHandle()).build();
}
use of org.apache.thrift.TException in project hive by apache.
the class HiveDatabaseMetaData method getServerInfo.
private TGetInfoResp getServerInfo(TGetInfoType type) throws SQLException {
TGetInfoReq req = new TGetInfoReq(sessHandle, type);
TGetInfoResp resp;
try {
resp = client.GetInfo(req);
} catch (TException e) {
throw new SQLException(e.getMessage(), "08S01", e);
}
Utils.verifySuccess(resp.getStatus());
return resp;
}
use of org.apache.thrift.TException in project hive by apache.
the class HiveDatabaseMetaData method getTableTypes.
public ResultSet getTableTypes() throws SQLException {
TGetTableTypesResp tableTypeResp;
try {
tableTypeResp = client.GetTableTypes(new TGetTableTypesReq(sessHandle));
} catch (TException e) {
throw new SQLException(e.getMessage(), "08S01", e);
}
Utils.verifySuccess(tableTypeResp.getStatus());
return new HiveQueryResultSet.Builder(connection).setClient(client).setSessionHandle(sessHandle).setStmtHandle(tableTypeResp.getOperationHandle()).build();
}
Aggregations