From 7a2be8c14177bfe47f4ea6c98c83b61b5e78d412 Mon Sep 17 00:00:00 2001 From: Ismail Simsek <6005685+ismailsimsek@users.noreply.github.com> Date: Sat, 15 Jun 2024 21:14:48 +0200 Subject: [PATCH] Check if configuration has isUnwrapped --- .../src/main/java/io/debezium/server/iceberg/IcebergUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debezium-server-iceberg-sink/src/main/java/io/debezium/server/iceberg/IcebergUtil.java b/debezium-server-iceberg-sink/src/main/java/io/debezium/server/iceberg/IcebergUtil.java index e6d5c4c4..b3a2e44b 100644 --- a/debezium-server-iceberg-sink/src/main/java/io/debezium/server/iceberg/IcebergUtil.java +++ b/debezium-server-iceberg-sink/src/main/java/io/debezium/server/iceberg/IcebergUtil.java @@ -65,6 +65,7 @@ public static boolean configIncludesUnwrapSmt() { //@TestingOnly static boolean configIncludesUnwrapSmt(Config config) { + // first lets find the config value for debezium statements ConfigValue stms = config.getConfigValue("debezium.transforms"); if (stms == null || stms.getValue() == null || stms.getValue().isEmpty() || stms.getValue().isBlank()){ return false; @@ -72,11 +73,10 @@ static boolean configIncludesUnwrapSmt(Config config) { String[] stmsList = stms.getValue().split(","); final String regexVal = "^io\\.debezium\\..*transforms\\.ExtractNew.*State$"; - + // we have debezium statements configured! let's check if we have event flattening config is set. for (String stmName : stmsList) { ConfigValue stmVal = config.getConfigValue("debezium.transforms."+stmName+".type"); if (stmVal != null && stmVal.getValue() != null && !stmVal.getValue().isEmpty() && !stmVal.getValue().isBlank() && stmVal.getValue().matches(regexVal)){ - System.out.println(stmVal.getValue()); return true; } }