use of com.airbnb.airpal.api.output.PersistentJobOutput in project airpal by airbnb.
the class OutputBuilderFactory method forJob.
public JobOutputBuilder forJob(Job job) throws IOException, InvalidQueryException {
PersistentJobOutput output = job.getOutput();
switch(output.getType()) {
case "csv":
return new CsvOutputBuilder(true, job.getUuid(), maxFileSizeBytes, isCompressedOutput);
case "hive":
HiveTablePersistentOutput hiveOutput = (HiveTablePersistentOutput) output;
URI location = output.getLocation();
if (location == null) {
throw new InvalidQueryException(format("Invalid table name '%s'", hiveOutput.getTmpTableName()));
}
return new HiveTableOutputBuilder(hiveOutput.getDestinationSchema(), hiveOutput.getTmpTableName());
default:
throw new IllegalArgumentException(format("OutputBuilder for type %s not found", output.getType()));
}
}
Aggregations