hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-hudi] yanghua commented on a change in pull request #1440: [HUDI-731] Add ChainedTransformer
Date Tue, 24 Mar 2020 02:35:42 GMT
yanghua commented on a change in pull request #1440: [HUDI-731] Add ChainedTransformer

 File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/transform/
 @@ -0,0 +1,30 @@
+package org.apache.hudi.utilities.transform;
+import org.apache.hudi.common.util.TypedProperties;
+import org.apache.spark.sql.Dataset;
+import org.apache.spark.sql.Row;
+import org.apache.spark.sql.SparkSession;
+import java.util.List;
+import java.util.function.Supplier;
+ * An abstract {@link Transformer} to chain other {@link Transformer}s and apply sequentially.
+ * <p>
+ * A subclass is to supply a {@link List} of {@link Transformer}s in desired sequence.
+ */
+public abstract class ChainedTransformer implements Transformer {
+  protected abstract Supplier<List<Transformer>> supplyTransformers();
+  @Override
+  public Dataset<Row> apply(JavaSparkContext jsc, SparkSession sparkSession, Dataset<Row>
rowDataset, TypedProperties properties) {
 Review comment:
   It would be better to have a test case which extends `ChainedTransformer ` and mock some
transformer to verify this function.

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message