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 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;

View File

@@ -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);

View File

@@ -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;