CsvToKeyValueMapper extends Mapper<LongWritable,Text,ImmutableBytesWritable,
        KeyValue> { @VisibleForTesting static List<ColumnInfo> buildColumnInfoList(Configuration conf) { return Lists.newArrayList( Iterables.transform( Splitter.on("|").split(conf.get(COLUMN_INFO_CONFKEY)), new Function<String, ColumnInfo>() { @Nullable @Override public ColumnInfo apply(@Nullable String input) { if (input.isEmpty()) { return null; } return ColumnInfo.fromString(input); } })); }   static final String UPSERT_HOOK_CLASS_CONFKEY; static final String FIELD_DELIMITER_CONFKEY; static final String QUOTE_CHAR_CONFKEY; static final String ESCAPE_CHAR_CONFKEY; static final String ARRAY_DELIMITER_CONFKEY; static final String TABLE_NAME_CONFKEY; static final String INDEX_TABLE_NAME_CONFKEY; static final String COLUMN_INFO_CONFKEY; static final String IGNORE_INVALID_ROW_CONFKEY; }
@Test public void testBuildColumnInfoList() { List<ColumnInfo> columnInfoList = ImmutableList.of( new ColumnInfo("idCol", PInteger.INSTANCE.getSqlType()), new ColumnInfo("unsignedIntCol", PUnsignedInt.INSTANCE.getSqlType()), new ColumnInfo("stringArrayCol", PIntegerArray.INSTANCE.getSqlType())); Configuration conf = new Configuration(); CsvToKeyValueMapper.configureColumnInfoList(conf, columnInfoList); List<ColumnInfo> fromConfig = CsvToKeyValueMapper.buildColumnInfoList(conf); assertEquals(columnInfoList, fromConfig); }