1
0

[HUDI-1826] Add ORC support in HoodieSnapshotExporter (#3130)

This commit is contained in:
Vaibhav Sinha
2021-06-23 14:34:25 +05:30
committed by GitHub
parent 2687eab8f0
commit 43b9c1fa1c
3 changed files with 4 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ public class HoodieSnapshotExporter {
public static class OutputFormatValidator implements IValueValidator<String> { public static class OutputFormatValidator implements IValueValidator<String> {
public static final String HUDI = "hudi"; 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 @Override
public void validate(String name, String value) { 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) @Parameter(names = {"--target-output-path"}, description = "Base path for the target output files (snapshots)", required = true)
public String targetOutputPath; 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) validateValueWith = OutputFormatValidator.class)
public String outputFormat; public String outputFormat;

View File

@@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class TestHoodieSnapshotExporter { public class TestHoodieSnapshotExporter {
@ParameterizedTest @ParameterizedTest
@ValueSource(strings = {"json", "parquet", "hudi"}) @ValueSource(strings = {"json", "parquet", "orc", "hudi"})
public void testValidateOutputFormatWithValidFormat(String format) { public void testValidateOutputFormatWithValidFormat(String format) {
assertDoesNotThrow(() -> { assertDoesNotThrow(() -> {
new OutputFormatValidator().validate(null, format); new OutputFormatValidator().validate(null, format);

View File

@@ -213,7 +213,7 @@ public class TestHoodieSnapshotExporter extends FunctionalTestHarness {
public class TestHoodieSnapshotExporterForNonHudi { public class TestHoodieSnapshotExporterForNonHudi {
@ParameterizedTest @ParameterizedTest
@ValueSource(strings = {"json", "parquet"}) @ValueSource(strings = {"json", "parquet", "orc"})
public void testExportAsNonHudi(String format) throws IOException { public void testExportAsNonHudi(String format) throws IOException {
HoodieSnapshotExporter.Config cfg = new Config(); HoodieSnapshotExporter.Config cfg = new Config();
cfg.sourceBasePath = sourcePath; cfg.sourceBasePath = sourcePath;