Tez控制输出的文件是否压缩并指定文件名

来源:互联网 发布:标准韩国语第二册淘宝 编辑:程序博客网 时间:2024/06/05 06:59

在如下的代码后:

TezConfiguration tezConf;if (conf != null) {tezConf = new TezConfiguration(conf);} else {tezConf = new TezConfiguration();}

加入:

/** * decide outputfile whether to be compress; */tezConf.setBoolean(FileOutputFormat.COMPRESS, tezConf.getBoolean("isCompress", false));/** * decide outputfile name; */tezConf.set("mapreduce.output.basename", tezConf.get("fileName", "Tez.log"));

更精确的控制,可以参看“org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K, V>“类。

0 0