Search in sources :

Example 1 with StatementOutputResponse

use of com.thinkbiganalytics.kylo.spark.model.StatementOutputResponse in project kylo by Teradata.

the class LivyRestModelTransformer method toUri.

public static URI toUri(Statement statement) {
    StatementOutputResponse sor = statement.getOutput();
    checkCodeWasWellFormed(sor);
    return serializeStatementOutputResponse(sor, URI.class);
}
Also used : StatementOutputResponse(com.thinkbiganalytics.kylo.spark.model.StatementOutputResponse)

Example 2 with StatementOutputResponse

use of com.thinkbiganalytics.kylo.spark.model.StatementOutputResponse 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)

Example 3 with StatementOutputResponse

use of com.thinkbiganalytics.kylo.spark.model.StatementOutputResponse in project kylo by Teradata.

the class LivyRestModelTransformer method toDataSources.

public static DataSources toDataSources(Statement statement) {
    StatementOutputResponse sor = statement.getOutput();
    checkCodeWasWellFormed(sor);
    return serializeStatementOutputResponse(sor, DataSources.class);
}
Also used : StatementOutputResponse(com.thinkbiganalytics.kylo.spark.model.StatementOutputResponse)

Aggregations

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