Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FooBarMultipleTextOutputFormat
- extends MultipleTextOutputFormat<NullWritable, Text> {
- protected String generateFileNameForKeyValue(NullWritable key,
- Text value,
- String name) {
- String line = value.toString();
- //TODO: I would like to parameterize the field that is picked
- //here. Something akin to using JobConf in Mapper.
- //i.e. instead of hard-coding [3] or [0], I would like
- //to get it from JobConf(or some other configuration) in some fashion
- String date = (line.split("\t"))[3].substring(0,10);
- String id = (line.split("\t"))[0];
- String partitionNumber = String.format("%05d", ID.getPartitionNumber(id));
- return date + "/pn_" + partitionNumber;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement