Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CombineHiveInputFormat through DummyRecordReader #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/main/java/com/hadoop/mapred/DeprecatedLzoTextInputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,43 @@ public RecordReader<LongWritable, Text> getRecordReader(InputSplit split,
if (LzoInputFormatCommon.isLzoFile(fileSplit.getPath().toString())) {
reporter.setStatus(split.toString());
return new DeprecatedLzoLineRecordReader(conf, (FileSplit)split);
} else if (LzoInputFormatCommon.isLzoIndexFile(fileSplit.getPath().toString())) {
return new DummyRecordReader();
} else {
// delegate non-LZO files to the TextInputFormat base class.
return super.getRecordReader(split, conf, reporter);
}
}

public static class DummyRecordReader implements RecordReader<LongWritable, Text> {

@Override
public float getProgress() throws IOException {
return 0;
}

@Override
public boolean next(LongWritable s, Text aLong) throws IOException {
return false;
}

@Override
public LongWritable createKey() {
return null;
}

@Override
public Text createValue() {
return null;
}

@Override
public long getPos() throws IOException {
return 0;
}

@Override
public void close() throws IOException {}
}

}