From 8f361da1579308e1b9991885caf5df3b48ad0882 Mon Sep 17 00:00:00 2001 From: zhangdonghao Date: Tue, 5 Nov 2024 21:12:42 +0800 Subject: [PATCH] [Feature][Transform-v2] Add metadata transform --- .../api/table/type/CommonOptions.java | 20 +++++++++---------- .../api/table/type/MetadataUtil.java | 2 +- .../seatunnel/SeaTunnelContainer.java | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/CommonOptions.java b/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/CommonOptions.java index 158144a9138..8b5b36682a8 100644 --- a/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/CommonOptions.java +++ b/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/CommonOptions.java @@ -30,34 +30,34 @@ public enum CommonOptions { /** * The key of {@link Column#getOptions()} to specify the column value is a json format string. */ - JSON("Json", 0), + JSON("Json", false), /** The key of {@link Column#getOptions()} to specify the column value is a metadata field. */ - METADATA("Metadata", 0), + METADATA("Metadata", false), /** * The key of {@link SeaTunnelRow#getOptions()} to store the partition value of the row value. */ - PARTITION("Partition", 1), + PARTITION("Partition", true), /** * The key of {@link SeaTunnelRow#getOptions()} to store the DATABASE value of the row value. */ - DATABASE("Database", 1), + DATABASE("Database", true), /** The key of {@link SeaTunnelRow#getOptions()} to store the TABLE value of the row value. */ - TABLE("Table", 1), + TABLE("Table", true), /** * The key of {@link SeaTunnelRow#getOptions()} to store the ROW_KIND value of the row value. */ - ROW_KIND("RowKind", 1), + ROW_KIND("RowKind", true), /** * The key of {@link SeaTunnelRow#getOptions()} to store the EVENT_TIME value of the row value. */ - EVENT_TIME("EventTime", 1), + EVENT_TIME("EventTime", true), /** The key of {@link SeaTunnelRow#getOptions()} to store the DELAY value of the row value. */ - DELAY("Delay", 1); + DELAY("Delay", true); private final String name; - private final int supportMetadataTrans; + private final boolean supportMetadataTrans; - CommonOptions(String name, int supportMetadataTrans) { + CommonOptions(String name, boolean supportMetadataTrans) { this.name = name; this.supportMetadataTrans = supportMetadataTrans; } diff --git a/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/MetadataUtil.java b/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/MetadataUtil.java index 0b407179ce6..42ab2035768 100644 --- a/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/MetadataUtil.java +++ b/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/MetadataUtil.java @@ -35,7 +35,7 @@ public class MetadataUtil { static { METADATA_FIELDS = new ArrayList<>(); Stream.of(CommonOptions.values()) - .filter(v -> v.getSupportMetadataTrans() == 1) + .filter(CommonOptions::isSupportMetadataTrans) .map(CommonOptions::getName) .forEach(METADATA_FIELDS::add); } diff --git a/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/seatunnel/SeaTunnelContainer.java b/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/seatunnel/SeaTunnelContainer.java index 759af67f9ce..03a0f87be8d 100644 --- a/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/seatunnel/SeaTunnelContainer.java +++ b/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/seatunnel/SeaTunnelContainer.java @@ -100,7 +100,7 @@ private GenericContainer createSeaTunnelServer() throws IOException, Interrup "seatunnel-engine:" + JDK_DOCKER_IMAGE))) .waitingFor(Wait.forLogMessage(".*received new worker register:.*", 1)); copySeaTunnelStarterToContainer(server); - server.setPortBindings(Collections.singletonList("5801:5801")); + server.setPortBindings(Arrays.asList("5801:5801", "8080:8080")); server.withCopyFileToContainer( MountableFile.forHostPath( PROJECT_ROOT_PATH