Skip to content

Commit

Permalink
make test better
Browse files Browse the repository at this point in the history
  • Loading branch information
laskoviymishka committed Feb 25, 2025
1 parent cc7d51b commit 2638ac8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/providers/clickhouse/model/model_ch_destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ func (d *ChDestination) ToReplicationFromPGSinkParams() ChDestinationWrapper {
func (d *ChDestination) FillDependentFields(transfer *model.Transfer) {
if !model.IsAppendOnlySource(transfer.Src) && !transfer.SnapshotOnly() {
d.IsUpdateable = true
d.IsDeleteable = true
if d.ShardCol != "" {
d.ShardCol = ""
logger.Log.Warn("turned off sharding on ch-dst, sharding is allowed only for queue-src")
Expand Down
4 changes: 3 additions & 1 deletion pkg/providers/clickhouse/sink_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ func (t *sinkTable) generateDDL(cols []abstract.ColSchema, distributed bool) str
if t.config.IsUpdateable() {
columnDefinitions = append(columnDefinitions, "`__data_transfer_commit_time` UInt64")
columnDefinitions = append(columnDefinitions, "`__data_transfer_delete_time` UInt64")
columnDefinitions = append(columnDefinitions, "`__data_transfer_is_deleted` UInt8 MATERIALIZED (if(__data_transfer_delete_time != 0, 1, 0))")
if t.config.IsDeleteable() {
columnDefinitions = append(columnDefinitions, "`__data_transfer_is_deleted` UInt8 MATERIALIZED (if(__data_transfer_delete_time != 0, 1, 0))")
}
}
_, _ = result.WriteString(fmt.Sprintf(" (%s)", strings.Join(columnDefinitions, ", ")))

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/pg2ch/replication/check_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestOptimizeCleanup(t *testing.T) {
require.NoError(t, err)
conn, err := pgcommon.NewPgConnPool(connConfig, logger.Log)
require.NoError(t, err)

Target.IsDeleteable = true
// Start transfer
transfer := helpers.MakeTransfer(helpers.TransferID, &Source, &Target, TransferType)
err = tasks.ActivateDelivery(context.Background(), nil, cpclient.NewFakeClient(), *transfer, helpers.EmptyRegistry())
Expand Down

0 comments on commit 2638ac8

Please sign in to comment.