CorcInputFormat implements InputFormat<NullWritable, Corc> { static StructTypeInfo getSchemaTypeInfo(Configuration conf) { String schemaTypeInfo = conf.get(SCHEMA_TYPE_INFO); if (schemaTypeInfo != null && !schemaTypeInfo.isEmpty()) { LOG.debug("Got schema typeInfo from conf: {}", schemaTypeInfo); return (StructTypeInfo) TypeInfoUtils.getTypeInfoFromTypeString(conf.get(SCHEMA_TYPE_INFO)); } return null; }  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 getSchemaTypeInfo() { conf.set(CorcInputFormat.SCHEMA_TYPE_INFO, "struct<a:string,b:string>"); StructTypeInfo typeInfo = new StructTypeInfoBuilder() .add("a", TypeInfoFactory.stringTypeInfo) .add("b", TypeInfoFactory.stringTypeInfo) .build(); assertThat(CorcInputFormat.getSchemaTypeInfo(conf), is(typeInfo)); }
@Test public void getSchemaTypeInfoNull() { assertThat(CorcInputFormat.getSchemaTypeInfo(conf), is(nullValue())); }
@Test public void getSchemaTypeInfoEmpty() { conf.set(CorcInputFormat.SCHEMA_TYPE_INFO, ""); assertThat(CorcInputFormat.getSchemaTypeInfo(conf), is(nullValue())); }