[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 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;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user