diff --git a/lib/debezium/converters/bit.go b/lib/debezium/converters/bit.go index e09c36cc..091a3ac0 100644 --- a/lib/debezium/converters/bit.go +++ b/lib/debezium/converters/bit.go @@ -28,7 +28,7 @@ func (b BitConverter) ToField(name string) debezium.Field { FieldName: name, DebeziumType: debezium.Bits, Type: debezium.Bytes, - Parameters: map[string]any{"length": b.charMaxLength}, + Parameters: map[string]any{"length": fmt.Sprint(b.charMaxLength)}, } } } diff --git a/lib/debezium/converters/bit_test.go b/lib/debezium/converters/bit_test.go index 62b9cca5..12721b1f 100644 --- a/lib/debezium/converters/bit_test.go +++ b/lib/debezium/converters/bit_test.go @@ -12,8 +12,8 @@ func TestBitConverter_ToField(t *testing.T) { field := NewBitConverter(0).ToField("foo") assert.Equal(t, "foo", field.FieldName) assert.Equal(t, "bytes", string(field.Type)) - assert.Equal(t, map[string]interface{}{"length": 0}, field.Parameters) assert.Equal(t, debezium.Bits, field.DebeziumType) + assert.Equal(t, map[string]interface{}{"length": "0"}, field.Parameters) } { // char max size 1 @@ -27,6 +27,7 @@ func TestBitConverter_ToField(t *testing.T) { assert.Equal(t, "foo", field.FieldName) assert.Equal(t, "bytes", string(field.Type)) assert.Equal(t, debezium.Bits, field.DebeziumType) + assert.Equal(t, map[string]interface{}{"length": "5"}, field.Parameters) } }