Skip to content
Merged
Show file tree
Hide file tree
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 @@ -167,7 +167,7 @@ public static String transformRawValue(
} else if (("bytes".equals(debeziumType) && className == null)) {
// MySQL binary, varbinary, blob
transformed = new String(Base64.getDecoder().decode(rawValue));
} else if ("bytes".equals(debeziumType) && decimalLogicalName().equals(className)) {
} else if ("bytes".equals(debeziumType) && className.endsWith(decimalLogicalName())) {
// MySQL numeric, fixed, decimal
try {
new BigDecimal(rawValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private DataType extractFieldType(DebeziumEvent.Field field) {
case "string":
return DataTypes.STRING();
case "bytes":
if (decimalLogicalName().equals(field.name())) {
if (field.name() != null && field.name().endsWith(decimalLogicalName())) {
int precision = field.parameters().get("connect.decimal.precision").asInt();
int scale = field.parameters().get("scale").asInt();
return DataTypes.DECIMAL(precision, scale);
Expand Down Expand Up @@ -270,7 +270,8 @@ private Map<String, String> extractRow(JsonNode recordRow, CdcSchema.Builder sch
} else if (("bytes".equals(postgresSqlType) && className == null)) {
// binary, varbinary
newValue = new String(Base64.getDecoder().decode(oldValue));
} else if ("bytes".equals(postgresSqlType) && decimalLogicalName().equals(className)) {
} else if ("bytes".equals(postgresSqlType)
&& className.endsWith(decimalLogicalName())) {
// numeric, decimal
try {
new BigDecimal(oldValue);
Expand Down