diff --git a/inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java b/inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java index 6e001ec6812..d7dd5081a25 100644 --- a/inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java +++ b/inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java @@ -37,6 +37,7 @@ import io.debezium.time.NanoTimestamp; import io.debezium.time.Timestamp; import io.debezium.time.ZonedTimestamp; +import org.apache.commons.lang.StringUtils; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.table.data.DecimalData; import org.apache.flink.table.data.GenericRowData; @@ -292,7 +293,7 @@ private static DeserializationRuntimeConverter convertToTime() { @Override public Object convert(Object dbzObj, Schema schema) { - if (dbzObj instanceof Long) { + if (dbzObj instanceof Long && StringUtils.isNotBlank(schema.name())) { // Because Oracle CDC has been shaded, the schema will have the prefix // 'org.apache.inlong.sort.cdc.oracle.shaded' added, // so we need to use `schemaName.endsWith()` to determine the Schema type. @@ -327,7 +328,7 @@ private static DeserializationRuntimeConverter convertToTimestamp(ZoneId serverT @Override public Object convert(Object dbzObj, Schema schema) { - if (dbzObj instanceof Long) { + if (dbzObj instanceof Long && StringUtils.isNotBlank(schema.name())) { // Because Oracle CDC has been shaded, the schema will have the prefix // 'org.apache.inlong.sort.cdc.oracle.shaded' added, // so we need to use `schemaName.endsWith()` to determine the Schema type. @@ -462,7 +463,8 @@ public Object convert(Object dbzObj, Schema schema) { // Because Oracle CDC has been shaded, the schema will have the prefix // 'org.apache.inlong.sort.cdc.oracle.shaded' added, // so we need to use `schemaName.endsWith()` to determine the Schema type. - if (schema.name().endsWith(VariableScaleDecimal.LOGICAL_NAME)) { + if (StringUtils.isNotBlank(schema.name()) + && schema.name().endsWith(VariableScaleDecimal.LOGICAL_NAME)) { SpecialValueDecimal decimal = VariableScaleDecimal.toLogical((Struct) dbzObj); bigDecimal = decimal.getDecimalValue().orElse(BigDecimal.ZERO); @@ -768,8 +770,8 @@ public Object convert(Object dbzObj, Schema schema, TableChange tableSchema) thr * @return the extracted data with schema */ private Object getValueWithSchema(Object fieldValue, String schemaName) { - if (fieldValue == null) { - return null; + if (fieldValue == null || StringUtils.isBlank(schemaName)) { + return fieldValue; } // Because Oracle CDC has been shaded, the schema will have the prefix // 'org.apache.inlong.sort.cdc.oracle.shaded' added,