Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down