CorcInputFormat implements InputFormat<NullWritable, Corc> { @Override public InputSplit[] getSplits(JobConf conf, int numSplits) throws IOException { return orcInputFormat.getSplits(conf, numSplits); }  static void setConverterFactoryClass(Configuration conf,
      Class<? extends ConverterFactory> converterFactoryClass); static void setTypeInfo(Configuration conf, StructTypeInfo typeInfo); static void setSchemaTypeInfo(Configuration conf, StructTypeInfo schemaTypeInfo); static void setSearchArgument(Configuration conf, SearchArgument searchArgument); static void setSearchArgumentKryo(Configuration conf, String searchArgumentKryo); @Override InputSplit[] getSplits(JobConf conf, int numSplits); @Override RecordReader<NullWritable, Corc> getRecordReader(InputSplit inputSplit, JobConf conf, Reporter reporter); static String toKryo(SearchArgument sarg); static final String ENABLE_ROW_LEVEL_SEARCH_ARGUMENT; }
@Test public void getSplits() throws IOException { conf.set("mapred.input.dir", temporaryFolder.getRoot().getCanonicalPath()); InputSplit[] splits = inputFormat.getSplits(conf, 1); assertThat(splits.length, is(1)); FileSplit actual = (FileSplit) splits[0]; assertThat(actual.getPath().toUri().getRawPath(), is(path.toUri().getRawPath())); assertThat(actual.getStart(), is(3L)); assertThat(actual.getLength(), is(136L)); OrcSplit orcSplit = (OrcSplit) actual; assertThat(orcSplit.getFileLength(), is(file.length())); StructTypeInfo typeInfo = new StructTypeInfoBuilder() .add("a", TypeInfoFactory.stringTypeInfo) .add("b", TypeInfoFactory.stringTypeInfo) .build(); CorcInputFormat.setTypeInfo(conf, typeInfo); CorcInputFormat.setConverterFactoryClass(conf, DefaultConverterFactory.class); RecordReader<NullWritable, Corc> reader = inputFormat.getRecordReader(actual, conf, reporter); Corc corc = reader.createValue(); reader.next(NullWritable.get(), corc); assertThat(corc.get("a"), is((Object) "A1")); assertThat(corc.get("b"), is((Object) "B1")); reader.close(); }