use of org.apache.hive.service.cli.OperationHandle in project hive by apache.
the class ThriftCLIServiceClient method getColumns.
/* (non-Javadoc)
* @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle)
*/
@Override
public OperationHandle getColumns(SessionHandle sessionHandle, String catalogName, String schemaName, String tableName, String columnName) throws HiveSQLException {
try {
TGetColumnsReq req = new TGetColumnsReq();
req.setSessionHandle(sessionHandle.toTSessionHandle());
req.setCatalogName(catalogName);
req.setSchemaName(schemaName);
req.setTableName(tableName);
req.setColumnName(columnName);
TGetColumnsResp resp = cliService.GetColumns(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.cli.OperationHandle 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.cli.OperationHandle in project hive by apache.
the class ThriftCLIServiceClient method downloadData.
@Override
public OperationHandle downloadData(SessionHandle sessionHandle, String tableName, String query, String format, Map<String, String> options) throws HiveSQLException {
try {
TDownloadDataReq req = new TDownloadDataReq(sessionHandle.toTSessionHandle());
req.setTableName(tableName);
req.setQuery(query);
req.setFormat(format);
req.setDownloadOptions(options);
TDownloadDataResp resp = cliService.DownloadData(req);
checkStatus(resp.getStatus());
TProtocolVersion protocol = sessionHandle.getProtocolVersion();
return new OperationHandle(resp.getOperationHandle(), protocol);
} catch (TException e) {
throw new HiveSQLException(e);
}
}
use of org.apache.hive.service.cli.OperationHandle 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.cli.OperationHandle in project hive by apache.
the class ThriftCLIServiceClient method getTables.
/* (non-Javadoc)
* @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List)
*/
@Override
public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException {
try {
TGetTablesReq req = new TGetTablesReq(sessionHandle.toTSessionHandle());
req.setTableName(tableName);
req.setTableTypes(tableTypes);
req.setSchemaName(schemaName);
TGetTablesResp resp = cliService.GetTables(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