[HUDI-821] Fixing JCommander param parsing in deltastreamer (#1525)
Co-authored-by: Alex Filipchik <alex.filipchik@csscompany.com>
This commit is contained in:
committed by
GitHub
parent
62bd3e7ded
commit
2a56f82908
@@ -54,7 +54,6 @@ import org.apache.spark.sql.SparkSession;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
@@ -65,7 +64,6 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
@@ -164,17 +162,6 @@ public class HoodieDeltaStreamer implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
protected static class TransformersConverter implements IStringConverter<List<String>> {
|
||||
|
||||
@Override
|
||||
public List<String> convert(String value) throws ParameterException {
|
||||
return value == null ? null : Arrays.stream(value.split(","))
|
||||
.map(String::trim)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
public static class Config implements Serializable {
|
||||
|
||||
@Parameter(names = {"--target-base-path"},
|
||||
@@ -228,8 +215,7 @@ public class HoodieDeltaStreamer implements Serializable {
|
||||
+ ". Allows transforming raw source Dataset to a target Dataset (conforming to target schema) before "
|
||||
+ "writing. Default : Not set. E:g - org.apache.hudi.utilities.transform.SqlQueryBasedTransformer (which "
|
||||
+ "allows a SQL query templated to be passed as a transformation function). "
|
||||
+ "Pass a comma-separated list of subclass names to chain the transformations.",
|
||||
converter = TransformersConverter.class)
|
||||
+ "Pass a comma-separated list of subclass names to chain the transformations.")
|
||||
public List<String> transformerClassNames = null;
|
||||
|
||||
@Parameter(names = {"--source-limit"}, description = "Maximum amount of data to read from source. "
|
||||
|
||||
@@ -256,8 +256,7 @@ public class HoodieMultiTableDeltaStreamer {
|
||||
+ ". Allows transforming raw source Dataset to a target Dataset (conforming to target schema) before "
|
||||
+ "writing. Default : Not set. E:g - org.apache.hudi.utilities.transform.SqlQueryBasedTransformer (which "
|
||||
+ "allows a SQL query templated to be passed as a transformation function). "
|
||||
+ "Pass a comma-separated list of subclass names to chain the transformations.",
|
||||
converter = HoodieDeltaStreamer.TransformersConverter.class)
|
||||
+ "Pass a comma-separated list of subclass names to chain the transformations.")
|
||||
public List<String> transformerClassNames = null;
|
||||
|
||||
@Parameter(names = {"--source-limit"}, description = "Maximum amount of data to read from source. "
|
||||
|
||||
Reference in New Issue
Block a user