@Test public void testExtractedInputForSingleTransformer() { Transformer t = createTransformer(Arrays.asList("a"), Arrays.asList("b")); Set<String> inputs = PipelineUtils.extractRequiredInputColumns(new Transformer[] {t}); assertEquals(inputs.size(), 1); assertTrue(inputs.containsAll(Arrays.asList("a"))); assertFalse(inputs.contains("b")); }
public static Set<String> extractRequiredInputColumns(Transformer[] transformers) { Set<String> inputColumns = new HashSet<>(); for(Transformer t : transformers) { inputColumns.addAll(t.getInputKeys()); } for(Transformer t : transformers) { Set<String> setDifference = new HashSet<>(t.getOutputKeys()); setDifference.removeAll(t.getInputKeys()); inputColumns.removeAll(setDifference); } return inputColumns; }
PipelineUtils implements Serializable { public static Set<String> extractRequiredInputColumns(Transformer[] transformers) { Set<String> inputColumns = new HashSet<>(); for(Transformer t : transformers) { inputColumns.addAll(t.getInputKeys()); } for(Transformer t : transformers) { Set<String> setDifference = new HashSet<>(t.getOutputKeys()); setDifference.removeAll(t.getInputKeys()); inputColumns.removeAll(setDifference); } return inputColumns; } }
PipelineUtils implements Serializable { public static Set<String> extractRequiredInputColumns(Transformer[] transformers) { Set<String> inputColumns = new HashSet<>(); for(Transformer t : transformers) { inputColumns.addAll(t.getInputKeys()); } for(Transformer t : transformers) { Set<String> setDifference = new HashSet<>(t.getOutputKeys()); setDifference.removeAll(t.getInputKeys()); inputColumns.removeAll(setDifference); } return inputColumns; }  }
PipelineUtils implements Serializable { public static Set<String> extractRequiredInputColumns(Transformer[] transformers) { Set<String> inputColumns = new HashSet<>(); for(Transformer t : transformers) { inputColumns.addAll(t.getInputKeys()); } for(Transformer t : transformers) { Set<String> setDifference = new HashSet<>(t.getOutputKeys()); setDifference.removeAll(t.getInputKeys()); inputColumns.removeAll(setDifference); } return inputColumns; }  static Set<String> extractRequiredInputColumns(Transformer[] transformers); static Set<String> extractRequiredOutputColumns(Transformer[] transformers); }
PipelineUtils implements Serializable { public static Set<String> extractRequiredInputColumns(Transformer[] transformers) { Set<String> inputColumns = new HashSet<>(); for(Transformer t : transformers) { inputColumns.addAll(t.getInputKeys()); } for(Transformer t : transformers) { Set<String> setDifference = new HashSet<>(t.getOutputKeys()); setDifference.removeAll(t.getInputKeys()); inputColumns.removeAll(setDifference); } return inputColumns; }  static Set<String> extractRequiredInputColumns(Transformer[] transformers); static Set<String> extractRequiredOutputColumns(Transformer[] transformers);  }