Search in sources :

Example 6 with TProtocolVersion

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

the class ThriftCLIServiceClient method getSchemas.

/* (non-Javadoc)
   * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String)
   */
@Override
public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, String schemaName) throws HiveSQLException {
    try {
        TGetSchemasReq req = new TGetSchemasReq(sessionHandle.toTSessionHandle());
        req.setCatalogName(catalogName);
        req.setSchemaName(schemaName);
        TGetSchemasResp resp = cliService.GetSchemas(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) TGetSchemasReq(org.apache.hive.service.rpc.thrift.TGetSchemasReq) TGetSchemasResp(org.apache.hive.service.rpc.thrift.TGetSchemasResp) OperationHandle(org.apache.hive.service.cli.OperationHandle) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Example 7 with TProtocolVersion

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

the class ThriftCLIServiceClient method getTypeInfo.

/* (non-Javadoc)
   * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle)
   */
@Override
public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException {
    try {
        TGetTypeInfoReq req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle());
        TGetTypeInfoResp resp = cliService.GetTypeInfo(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 : TGetTypeInfoReq(org.apache.hive.service.rpc.thrift.TGetTypeInfoReq) TGetTypeInfoResp(org.apache.hive.service.rpc.thrift.TGetTypeInfoResp) TProtocolVersion(org.apache.hive.service.rpc.thrift.TProtocolVersion) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationHandle(org.apache.hive.service.cli.OperationHandle) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Example 8 with TProtocolVersion

use of org.apache.hive.service.rpc.thrift.TProtocolVersion 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)

Example 9 with TProtocolVersion

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

the class ThriftCLIServiceClient method getPrimaryKeys.

@Override
public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, String catalog, String schema, String table) throws HiveSQLException {
    try {
        TGetPrimaryKeysReq req = new TGetPrimaryKeysReq(sessionHandle.toTSessionHandle());
        req.setCatalogName(catalog);
        req.setSchemaName(schema);
        req.setTableName(table);
        TGetPrimaryKeysResp resp = cliService.GetPrimaryKeys(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 : TGetPrimaryKeysReq(org.apache.hive.service.rpc.thrift.TGetPrimaryKeysReq) TProtocolVersion(org.apache.hive.service.rpc.thrift.TProtocolVersion) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TGetPrimaryKeysResp(org.apache.hive.service.rpc.thrift.TGetPrimaryKeysResp) OperationHandle(org.apache.hive.service.cli.OperationHandle) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Example 10 with TProtocolVersion

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

the class ThriftCLIServiceClient method getCrossReference.

@Override
public OperationHandle getCrossReference(SessionHandle sessionHandle, String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException {
    try {
        TGetCrossReferenceReq req = new TGetCrossReferenceReq(sessionHandle.toTSessionHandle());
        req.setParentCatalogName(primaryCatalog);
        req.setParentSchemaName(primarySchema);
        req.setParentTableName(primaryTable);
        req.setForeignCatalogName(foreignCatalog);
        req.setForeignSchemaName(foreignSchema);
        req.setForeignTableName(foreignTable);
        TGetCrossReferenceResp resp = cliService.GetCrossReference(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) TGetCrossReferenceReq(org.apache.hive.service.rpc.thrift.TGetCrossReferenceReq) TGetCrossReferenceResp(org.apache.hive.service.rpc.thrift.TGetCrossReferenceResp) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationHandle(org.apache.hive.service.cli.OperationHandle) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Aggregations

TProtocolVersion (org.apache.hive.service.rpc.thrift.TProtocolVersion)13 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)11 OperationHandle (org.apache.hive.service.cli.OperationHandle)11 TException (org.apache.thrift.TException)10 HashMap (java.util.HashMap)1 HiveConf (org.apache.hadoop.hive.conf.HiveConf)1 SessionHandle (org.apache.hive.service.cli.SessionHandle)1 ExecuteStatementOperation (org.apache.hive.service.cli.operation.ExecuteStatementOperation)1 OperationManager (org.apache.hive.service.cli.operation.OperationManager)1 TExecuteStatementReq (org.apache.hive.service.rpc.thrift.TExecuteStatementReq)1 TExecuteStatementResp (org.apache.hive.service.rpc.thrift.TExecuteStatementResp)1 TGetCatalogsReq (org.apache.hive.service.rpc.thrift.TGetCatalogsReq)1 TGetCatalogsResp (org.apache.hive.service.rpc.thrift.TGetCatalogsResp)1 TGetColumnsReq (org.apache.hive.service.rpc.thrift.TGetColumnsReq)1 TGetColumnsResp (org.apache.hive.service.rpc.thrift.TGetColumnsResp)1 TGetCrossReferenceReq (org.apache.hive.service.rpc.thrift.TGetCrossReferenceReq)1 TGetCrossReferenceResp (org.apache.hive.service.rpc.thrift.TGetCrossReferenceResp)1 TGetFunctionsReq (org.apache.hive.service.rpc.thrift.TGetFunctionsReq)1 TGetFunctionsResp (org.apache.hive.service.rpc.thrift.TGetFunctionsResp)1 TGetPrimaryKeysReq (org.apache.hive.service.rpc.thrift.TGetPrimaryKeysReq)1