Skip to content

Commit

Permalink
KYLIN-3463 use LazyOutputFormat to prevent to create zero-sized defau…
Browse files Browse the repository at this point in the history
…lt output for optimize jobs

Signed-off-by: shaofengshi <shaofengshi@apache.org>
  • Loading branch information
kyotoYaho authored and shaofengshi committed Aug 7, 2018
1 parent b938a1c commit e7bacd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.LazyOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
import org.apache.kylin.common.KylinConfig;
import org.apache.kylin.cube.CubeInstance;
Expand Down Expand Up @@ -78,7 +79,8 @@ public int run(String[] args) throws Exception {
job.setInputFormatClass(SequenceFileInputFormat.class);
FileInputFormat.setInputPaths(job, input);
// Output
job.setOutputFormatClass(SequenceFileOutputFormat.class);
//// prevent to create zero-sized default output
LazyOutputFormat.setOutputFormatClass(job, SequenceFileOutputFormat.class);
FileOutputFormat.setOutputPath(job, output);

// set job configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.LazyOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
import org.apache.kylin.common.KylinConfig;
import org.apache.kylin.cube.CubeInstance;
Expand Down Expand Up @@ -80,7 +81,8 @@ public int run(String[] args) throws Exception {
job.setInputFormatClass(SequenceFileInputFormat.class);
FileInputFormat.setInputPaths(job, input);
// Output
job.setOutputFormatClass(SequenceFileOutputFormat.class);
//// prevent to create zero-sized default output
LazyOutputFormat.setOutputFormatClass(job, SequenceFileOutputFormat.class);
FileOutputFormat.setOutputPath(job, output);

// set job configuration
Expand Down

0 comments on commit e7bacd3

Please sign in to comment.