Skip to content

Commit

Permalink
add sink level config output-old-value for open and debezium
Browse files Browse the repository at this point in the history
  • Loading branch information
sdojjy committed Apr 17, 2024
1 parent 9af2cd4 commit deda659
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/sink/codec/debezium/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit deda659

Please sign in to comment.