Skip to content
Open
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
5 changes: 3 additions & 2 deletions drivers/abstract/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func (a *AbstractDriver) Backfill(mainCtx context.Context, backfilledStreams cha

logger.Infof("Thread[%s]: created writer for chunk min[%s] and max[%s] of stream %s", threadID, chunk.Min, chunk.Max, stream.ID())

hasCDCTimestamp, _ := stream.GetStream().Schema.GetProperty(constants.CdcTimestamp)

return a.driver.ChunkIterator(backfillCtx, stream, chunk, func(ctx context.Context, data map[string]any, sourceBytes int64) error {
olakeID := utils.GetKeysHash(data, stream.GetStream().SourceDefinedPrimaryKey.Array()...)
olakeColumns := map[string]any{
Expand All @@ -84,8 +86,7 @@ func (a *AbstractDriver) Backfill(mainCtx context.Context, backfilledStreams cha
constants.OlakeTimestamp: time.Now().UTC(),
}

// Add CDC specific columns only for CDC mode
if stream.GetSyncMode() == types.CDC {
if hasCDCTimestamp {
olakeColumns[constants.CdcTimestamp] = time.Unix(0, 0)
}

Expand Down