public Data mapRow(Row rs) { String csvRow = rs.stringValue(); int commaCount = StringUtils.countMatches(csvRow, ","); if (expectedCommaCount <= commaCount) { Data data = new Data(0, null, csvRow, DataEventType.INSERT, triggerHistory .getSourceTableName(), null, triggerHistory, batch.getChannelId(), null, null); data.putAttribute(Data.ATTRIBUTE_ROUTER_ID, triggerRouter.getRouter() .getRouterId()); return data; } else { throw new SymmetricException( "The extracted row data did not have the expected (%d) number of columns: %s", expectedCommaCount, csvRow); } } });