[HUDI-1826] Add ORC support in HoodieSnapshotExporter (#3130)
This commit is contained in:
@@ -85,7 +85,7 @@ public class HoodieSnapshotExporter {
|
||||
public static class OutputFormatValidator implements IValueValidator<String> {
|
||||
|
||||
public static final String HUDI = "hudi";
|
||||
public static final List<String> FORMATS = CollectionUtils.createImmutableList("json", "parquet", HUDI);
|
||||
public static final List<String> FORMATS = CollectionUtils.createImmutableList("json", "parquet", "orc", HUDI);
|
||||
|
||||
@Override
|
||||
public void validate(String name, String value) {
|
||||
@@ -104,7 +104,7 @@ public class HoodieSnapshotExporter {
|
||||
@Parameter(names = {"--target-output-path"}, description = "Base path for the target output files (snapshots)", required = true)
|
||||
public String targetOutputPath;
|
||||
|
||||
@Parameter(names = {"--output-format"}, description = "Output format for the exported dataset; accept these values: json|parquet|hudi", required = true,
|
||||
@Parameter(names = {"--output-format"}, description = "Output format for the exported dataset; accept these values: json|parquet|orc|hudi", required = true,
|
||||
validateValueWith = OutputFormatValidator.class)
|
||||
public String outputFormat;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
public class TestHoodieSnapshotExporter {
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"json", "parquet", "hudi"})
|
||||
@ValueSource(strings = {"json", "parquet", "orc", "hudi"})
|
||||
public void testValidateOutputFormatWithValidFormat(String format) {
|
||||
assertDoesNotThrow(() -> {
|
||||
new OutputFormatValidator().validate(null, format);
|
||||
|
||||
@@ -213,7 +213,7 @@ public class TestHoodieSnapshotExporter extends FunctionalTestHarness {
|
||||
public class TestHoodieSnapshotExporterForNonHudi {
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"json", "parquet"})
|
||||
@ValueSource(strings = {"json", "parquet", "orc"})
|
||||
public void testExportAsNonHudi(String format) throws IOException {
|
||||
HoodieSnapshotExporter.Config cfg = new Config();
|
||||
cfg.sourceBasePath = sourcePath;
|
||||
|
||||
Reference in New Issue
Block a user