CsvBulkImportUtil { public static void initCsvImportJob(Configuration conf, String tableName, char fieldDelimiter, char quoteChar, char escapeChar, String arrayDelimiter, List<ColumnInfo> columnInfoList, boolean ignoreInvalidRows) { Preconditions.checkNotNull(tableName); Preconditions.checkNotNull(columnInfoList); Preconditions.checkArgument(!columnInfoList.isEmpty(), "Column info list is empty"); conf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, tableName); conf.set(CsvToKeyValueMapper.FIELD_DELIMITER_CONFKEY, String.valueOf(fieldDelimiter)); conf.set(CsvToKeyValueMapper.QUOTE_CHAR_CONFKEY, String.valueOf(quoteChar)); conf.set(CsvToKeyValueMapper.ESCAPE_CHAR_CONFKEY, String.valueOf(escapeChar)); if (arrayDelimiter != null) { conf.set(CsvToKeyValueMapper.ARRAY_DELIMITER_CONFKEY, arrayDelimiter); } CsvToKeyValueMapper.configureColumnInfoList(conf, columnInfoList); conf.setBoolean(CsvToKeyValueMapper.IGNORE_INVALID_ROW_CONFKEY, ignoreInvalidRows); }  static void initCsvImportJob(Configuration conf, String tableName, char fieldDelimiter, char quoteChar, char escapeChar,
            String arrayDelimiter,  List<ColumnInfo> columnInfoList, boolean ignoreInvalidRows); static void configurePreUpsertProcessor(Configuration conf,
            Class<? extends ImportPreUpsertKeyValueProcessor> processorClass);  }
@Test public void testInitCsvImportJob() { Configuration conf = new Configuration(); String tableName = "SCHEMANAME.TABLENAME"; char delimiter = '!'; char quote = '"'; char escape = '\\'; List<ColumnInfo> columnInfoList = ImmutableList.of( new ColumnInfo("MYCOL", PInteger.INSTANCE.getSqlType())); CsvBulkImportUtil.initCsvImportJob( conf, tableName, delimiter, quote, escape, null, columnInfoList, true); assertEquals(tableName, conf.get(CsvToKeyValueMapper.TABLE_NAME_CONFKEY)); assertEquals("!", conf.get(CsvToKeyValueMapper.FIELD_DELIMITER_CONFKEY)); assertNull(conf.get(CsvToKeyValueMapper.ARRAY_DELIMITER_CONFKEY)); assertEquals(columnInfoList, CsvToKeyValueMapper.buildColumnInfoList(conf)); assertEquals(true, conf.getBoolean(CsvToKeyValueMapper.IGNORE_INVALID_ROW_CONFKEY, false)); }