use of com.thinkbiganalytics.kylo.spark.livy.SparkLivySaveException in project kylo by Teradata.
the class LivyRestModelTransformer method toSaveResponse.
public static SaveResponse toSaveResponse(Statement statement) {
StatementOutputResponse sor = statement.getOutput();
checkCodeWasWellFormed(sor);
if (statement.getState() != StatementState.available) {
SaveResponse response = new SaveResponse();
response.setStatus(StatementStateTranslator.translateToSaveResponse(statement.getState()));
return response;
}
SaveResponse saveResponse = serializeStatementOutputResponse(sor, SaveResponse.class);
if (saveResponse.getStatus() == SaveResponse.Status.ERROR) {
throw new SparkLivySaveException(saveResponse.getMessage(), saveResponse.getId());
}
return saveResponse;
}
Aggregations