Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#9090
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
CharlesCheung96 authored and ti-chi-bot committed May 30, 2023
1 parent 6330ad2 commit 93bea23
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cdc/api/v2/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,20 @@ var defaultAPIConfig = &ReplicaConfig{
Delimiter: config.Comma,
NullString: config.NULL,
},
<<<<<<< HEAD
EncoderConcurrency: 16,
Terminator: config.CRLF,
DateSeparator: config.DateSeparatorDay.String(),
EnablePartitionSeparator: true,
EnableKafkaSinkV2: false,
=======
EncoderConcurrency: util.AddressOf(16),
Terminator: util.AddressOf(config.CRLF),
DateSeparator: util.AddressOf(config.DateSeparatorDay.String()),
EnablePartitionSeparator: util.AddressOf(true),
EnableKafkaSinkV2: util.AddressOf(false),
OnlyOutputUpdatedColumns: util.AddressOf(false),
>>>>>>> edda949d87 (config(ticdc): fix deafult setting of DateSeparator (#9090))
},
Consistent: &ConsistentConfig{
Level: "none",
Expand Down
9 changes: 9 additions & 0 deletions pkg/cmd/util/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,19 @@ func TestAndWriteExampleReplicaTOML(t *testing.T) {
Delimiter: string(config.Comma),
NullString: config.NULL,
},
<<<<<<< HEAD
Terminator: "\r\n",
DateSeparator: config.DateSeparatorDay.String(),
EnablePartitionSeparator: true,
Protocol: "open-protocol",
=======
Terminator: util.AddressOf("\r\n"),
DateSeparator: util.AddressOf(config.DateSeparatorDay.String()),
EnablePartitionSeparator: util.AddressOf(true),
EnableKafkaSinkV2: util.AddressOf(false),
OnlyOutputUpdatedColumns: util.AddressOf(false),
Protocol: util.AddressOf("open-protocol"),
>>>>>>> edda949d87 (config(ticdc): fix deafult setting of DateSeparator (#9090))
}, cfg.Sink)
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/config/config_test_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const (
"sink": {
"encoder-concurrency": 16,
"terminator": "\r\n",
<<<<<<< HEAD
=======
"date-separator": "day",
>>>>>>> edda949d87 (config(ticdc): fix deafult setting of DateSeparator (#9090))
"dispatch-rules": [
{
"db-name": "a",
Expand Down
9 changes: 9 additions & 0 deletions pkg/config/replica_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,20 @@ var defaultReplicaConfig = &ReplicaConfig{
Delimiter: Comma,
NullString: NULL,
},
<<<<<<< HEAD
EncoderConcurrency: 16,
Terminator: CRLF,
DateSeparator: DateSeparatorDay.String(),
EnablePartitionSeparator: true,
EnableKafkaSinkV2: false,
=======
EncoderConcurrency: util.AddressOf(16),
Terminator: util.AddressOf(CRLF),
DateSeparator: util.AddressOf(DateSeparatorDay.String()),
EnablePartitionSeparator: util.AddressOf(true),
EnableKafkaSinkV2: util.AddressOf(false),
OnlyOutputUpdatedColumns: util.AddressOf(false),
>>>>>>> edda949d87 (config(ticdc): fix deafult setting of DateSeparator (#9090))
TiDBSourceID: 1,
},
Consistent: &ConsistentConfig{
Expand Down
5 changes: 4 additions & 1 deletion pkg/sink/cloudstorage/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ func TestConfigApply(t *testing.T) {
expected.FlushInterval = 10 * time.Second
expected.FileSize = 16 * 1024 * 1024
expected.FileIndexWidth = config.DefaultFileIndexWidth
expected.DateSeparator = config.DateSeparatorNone.String()
expected.DateSeparator = config.DateSeparatorDay.String()
expected.EnablePartitionSeparator = true
uri := "s3://bucket/prefix?worker-count=32&flush-interval=10s&file-size=16777216&protocol=csv"
sinkURI, err := url.Parse(uri)
require.Nil(t, err)

replicaConfig := config.GetDefaultReplicaConfig()
<<<<<<< HEAD
replicaConfig.Sink.DateSeparator = config.DateSeparatorNone.String()
=======
>>>>>>> edda949d87 (config(ticdc): fix deafult setting of DateSeparator (#9090))
err = replicaConfig.ValidateAndAdjust(sinkURI)
require.NoError(t, err)
cfg := NewConfig()
Expand Down

0 comments on commit 93bea23

Please sign in to comment.