Search in sources :

Example 1 with SparkLivySaveException

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;
}
Also used : StatementOutputResponse(com.thinkbiganalytics.kylo.spark.model.StatementOutputResponse) SaveResponse(com.thinkbiganalytics.spark.rest.model.SaveResponse) SparkLivySaveException(com.thinkbiganalytics.kylo.spark.livy.SparkLivySaveException)

Aggregations

SparkLivySaveException (com.thinkbiganalytics.kylo.spark.livy.SparkLivySaveException)1 StatementOutputResponse (com.thinkbiganalytics.kylo.spark.model.StatementOutputResponse)1 SaveResponse (com.thinkbiganalytics.spark.rest.model.SaveResponse)1