Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- */
- private static final long serialVersionUID = 269187228897275370L;
- private List<Map<String, String>> extractedIdentifiers;
- public EnrichmentIdentifiersBuilder(List<Map<String, String>> extractedIdentifiers) {
- //super();
- this.extractedIdentifiers = extractedIdentifiers;
- }
- public void addIdentifiers(DataFrame identifiers)
- {
- final List<String> parameters=Arrays.asList(identifiers.schema().fieldNames());
- identifiers.foreach(new MyFunction<Row, BoxedUnit>() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- @Override
- public BoxedUnit apply(Row line)
- {
- for (int i = 0; i < parameters.size(); i++)
- {
- Map<String, String> identifier= new HashMap<>();
- identifier.put(parameters.get(i), line.getString(i));
- extractedIdentifiers.add(identifier);
- }
- return BoxedUnit.UNIT;
- }
- });
- }
Add Comment
Please, Sign In to add comment