Search in sources :

Example 96 with TException

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

Example 97 with TException

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

Example 98 with TException

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

Example 99 with TException

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

Example 100 with TException

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();
}
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)

Aggregations

TException (org.apache.thrift.TException)381 IOException (java.io.IOException)164 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)57 NoSuchObjectException (org.apache.hadoop.hive.metastore.api.NoSuchObjectException)48 ArrayList (java.util.ArrayList)42 HashMap (java.util.HashMap)40 Table (org.apache.hadoop.hive.metastore.api.Table)38 Map (java.util.Map)30 TBinaryProtocol (org.apache.thrift.protocol.TBinaryProtocol)29 AuthorizationException (org.apache.storm.generated.AuthorizationException)27 Test (org.junit.Test)26 List (java.util.List)25 InvalidObjectException (org.apache.hadoop.hive.metastore.api.InvalidObjectException)24 UnknownHostException (java.net.UnknownHostException)23 TProtocol (org.apache.thrift.protocol.TProtocol)23 FileNotFoundException (java.io.FileNotFoundException)22 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)22 InvalidMetaException (com.netflix.metacat.common.server.connectors.exception.InvalidMetaException)21 LoginException (javax.security.auth.login.LoginException)21 ConnectorException (com.netflix.metacat.common.server.connectors.exception.ConnectorException)20