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