Search in sources :

Example 1 with TGetTableTypesReq

use of org.apache.hive.service.rpc.thrift.TGetTableTypesReq 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();
}
Also used : TException(org.apache.thrift.TException) SQLException(java.sql.SQLException) TGetTableTypesResp(org.apache.hive.service.rpc.thrift.TGetTableTypesResp) TGetTableTypesReq(org.apache.hive.service.rpc.thrift.TGetTableTypesReq)

Example 2 with TGetTableTypesReq

use of org.apache.hive.service.rpc.thrift.TGetTableTypesReq in project hive by apache.

the class ThriftCLIServiceClient method getTableTypes.

/* (non-Javadoc)
   * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle)
   */
@Override
public OperationHandle getTableTypes(SessionHandle sessionHandle) throws HiveSQLException {
    try {
        TGetTableTypesReq req = new TGetTableTypesReq(sessionHandle.toTSessionHandle());
        TGetTableTypesResp resp = cliService.GetTableTypes(req);
        checkStatus(resp.getStatus());
        TProtocolVersion protocol = sessionHandle.getProtocolVersion();
        return new OperationHandle(resp.getOperationHandle(), protocol);
    } catch (HiveSQLException e) {
        throw e;
    } catch (Exception e) {
        throw new HiveSQLException(e);
    }
}
Also used : TProtocolVersion(org.apache.hive.service.rpc.thrift.TProtocolVersion) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TGetTableTypesResp(org.apache.hive.service.rpc.thrift.TGetTableTypesResp) OperationHandle(org.apache.hive.service.cli.OperationHandle) TGetTableTypesReq(org.apache.hive.service.rpc.thrift.TGetTableTypesReq) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Aggregations

TGetTableTypesReq (org.apache.hive.service.rpc.thrift.TGetTableTypesReq)2 TGetTableTypesResp (org.apache.hive.service.rpc.thrift.TGetTableTypesResp)2 TException (org.apache.thrift.TException)2 SQLException (java.sql.SQLException)1 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)1 OperationHandle (org.apache.hive.service.cli.OperationHandle)1 TProtocolVersion (org.apache.hive.service.rpc.thrift.TProtocolVersion)1