@Test public void testExtractedInputForIndependentTransformers() { Transformer t1 = createTransformer(Arrays.asList("a", "b", "c"), Arrays.asList("a1", "b1", "c")); Transformer t2 = createTransformer(Arrays.asList("d", "e", "f"), Arrays.asList("d1", "e1", "f1")); Set<String> inputs = PipelineUtils.extractRequiredInputColumns(new Transformer[] {t1, t2}); assertEquals(inputs.size(), 6); assertTrue(inputs.containsAll(Arrays.asList("a","b","c","d","e","f"))); assertFalse(inputs.contains("a1")); assertFalse(inputs.contains("b1")); assertFalse(inputs.contains("d1")); assertFalse(inputs.contains("e1")); assertFalse(inputs.contains("f1")); }
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);  }