CorcInputFormat implements InputFormat<NullWritable, Corc> { static SearchArgument getSearchArgument(Configuration conf) { String searchArgumentKryo = conf.get(SEARCH_ARGUMENT); if (searchArgumentKryo == null) { return null; } return ConvertAstToSearchArg.create(searchArgumentKryo); }  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 getSearchArgument() { SearchArgument searchArgument = SearchArgumentFactory.newBuilder().startAnd().equals("a", PredicateLeaf.Type.STRING, "b").end().build(); conf.set(CorcInputFormat.SEARCH_ARGUMENT, CorcInputFormat.toKryo(searchArgument)); SearchArgument sa = CorcInputFormat.getSearchArgument(conf); String kryo = CorcInputFormat.toKryo(sa); assertThat(kryo, is(CorcInputFormat.toKryo(searchArgument))); }
@Test public void getSearchArgumentNull() { SearchArgument searchArgument = CorcInputFormat.getSearchArgument(conf); assertThat(searchArgument, is(nullValue())); }