From deda65994ac2466c31c763645540e198b5fbd91c Mon Sep 17 00:00:00 2001 From: jiangjianyuan Date: Wed, 17 Apr 2024 16:00:33 +0800 Subject: [PATCH] add sink level config output-old-value for open and debezium --- pkg/sink/codec/debezium/codec.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/sink/codec/debezium/codec.go b/pkg/sink/codec/debezium/codec.go index f451e62764d..94cec8ded7c 100644 --- a/pkg/sink/codec/debezium/codec.go +++ b/pkg/sink/codec/debezium/codec.go @@ -35,10 +35,9 @@ import ( ) type dbzCodec struct { - config *common.Config - outputOldValue bool - clusterID string - nowFunc func() time.Time + config *common.Config + clusterID string + nowFunc func() time.Time } func (c *dbzCodec) writeDebeziumFieldValues( @@ -585,7 +584,7 @@ func (c *dbzCodec) EncodeRowChangedEvent( err = c.writeDebeziumFieldValues(jWriter, "before", e.GetPreColumns(), e.TableInfo) } else if e.IsUpdate() { jWriter.WriteStringField("op", "u") - if c.outputOldValue { + if c.config.OutputOldValue { err = c.writeDebeziumFieldValues(jWriter, "before", e.GetPreColumns(), e.TableInfo) } if err == nil {