@Test public void testGetTransformersNames() { Transformer t1 = (jsc, sparkSession, dataset, properties) -> dataset.withColumnRenamed("foo", "bar"); Transformer t2 = (jsc, sparkSession, dataset, properties) -> dataset.withColumn("bar", dataset.col("bar").cast(IntegerType)); ChainedTransformer transformer = new ChainedTransformer(Arrays.asList(t1, t2)); List<String> classNames = transformer.getTransformersNames(); assertEquals(t1.getClass().getName(), classNames.get(0)); assertEquals(t2.getClass().getName(), classNames.get(1)); }
public List<String> getTransformersNames() { return transformers.stream().map(t -> t.getClass().getName()).collect(Collectors.toList()); }
ChainedTransformer implements Transformer { public List<String> getTransformersNames() { return transformers.stream().map(t -> t.getClass().getName()).collect(Collectors.toList()); } }
ChainedTransformer implements Transformer { public List<String> getTransformersNames() { return transformers.stream().map(t -> t.getClass().getName()).collect(Collectors.toList()); } ChainedTransformer(List<Transformer> transformers); }
ChainedTransformer implements Transformer { public List<String> getTransformersNames() { return transformers.stream().map(t -> t.getClass().getName()).collect(Collectors.toList()); } ChainedTransformer(List<Transformer> transformers); List<String> getTransformersNames(); @Override Dataset<Row> apply(JavaSparkContext jsc, SparkSession sparkSession, Dataset<Row> rowDataset, TypedProperties properties); }
ChainedTransformer implements Transformer { public List<String> getTransformersNames() { return transformers.stream().map(t -> t.getClass().getName()).collect(Collectors.toList()); } ChainedTransformer(List<Transformer> transformers); List<String> getTransformersNames(); @Override Dataset<Row> apply(JavaSparkContext jsc, SparkSession sparkSession, Dataset<Row> rowDataset, TypedProperties properties);  }