Skip to content

Commit

Permalink
sink(ticdc): set default value of DateSeparator to day (#8998) (#9033)
Browse files Browse the repository at this point in the history
close #8997
  • Loading branch information
ti-chi-bot authored May 25, 2023
1 parent 39d9bf8 commit f926a1b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cdc/api/v2/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var defaultAPIConfig = &ReplicaConfig{
},
EncoderConcurrency: 16,
Terminator: config.CRLF,
DateSeparator: config.DateSeparatorNone.String(),
DateSeparator: config.DateSeparatorDay.String(),
EnablePartitionSeparator: true,
},
Consistent: &ConsistentConfig{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func TestCloudStorageWriteEventsWithoutDateSeparator(t *testing.T) {
require.Nil(t, err)

replicaConfig := config.GetDefaultReplicaConfig()
replicaConfig.Sink.DateSeparator = config.DateSeparatorNone.String()
replicaConfig.Sink.Protocol = config.ProtocolCsv.String()
replicaConfig.Sink.FileIndexWidth = 6
errCh := make(chan error, 5)
Expand Down
4 changes: 3 additions & 1 deletion cdc/sinkv2/eventsink/cloudstorage/dml_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ func testDMLWorker(ctx context.Context, t *testing.T, dir string) *dmlWorker {
sinkURI, err := url.Parse(uri)
require.Nil(t, err)
cfg := cloudstorage.NewConfig()
err = cfg.Apply(context.TODO(), sinkURI, config.GetDefaultReplicaConfig())
replicaConfig := config.GetDefaultReplicaConfig()
replicaConfig.Sink.DateSeparator = config.DateSeparatorNone.String()
err = cfg.Apply(context.TODO(), sinkURI, replicaConfig)
cfg.FileIndexWidth = 6
require.Nil(t, err)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/util/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func TestAndWriteExampleReplicaTOML(t *testing.T) {
NullString: config.NULL,
},
Terminator: "\r\n",
DateSeparator: config.DateSeparatorNone.String(),
DateSeparator: config.DateSeparatorDay.String(),
EnablePartitionSeparator: true,
Protocol: "open-protocol",
}, cfg.Sink)
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/replica_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var defaultReplicaConfig = &ReplicaConfig{
},
EncoderConcurrency: 16,
Terminator: CRLF,
DateSeparator: DateSeparatorNone.String(),
DateSeparator: DateSeparatorDay.String(),
EnablePartitionSeparator: true,
TiDBSourceID: 1,
},
Expand Down
1 change: 1 addition & 0 deletions pkg/sink/cloudstorage/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestConfigApply(t *testing.T) {
require.Nil(t, err)

replicaConfig := config.GetDefaultReplicaConfig()
replicaConfig.Sink.DateSeparator = config.DateSeparatorNone.String()
err = replicaConfig.ValidateAndAdjust(sinkURI)
require.NoError(t, err)
cfg := NewConfig()
Expand Down
1 change: 1 addition & 0 deletions pkg/sink/cloudstorage/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func testFilePathGenerator(ctx context.Context, t *testing.T, dir string) *FileP
sinkURI, err := url.Parse(uri)
require.NoError(t, err)
replicaConfig := config.GetDefaultReplicaConfig()
replicaConfig.Sink.DateSeparator = config.DateSeparatorNone.String()
replicaConfig.Sink.Protocol = config.ProtocolOpen.String()
replicaConfig.Sink.FileIndexWidth = 6
cfg := NewConfig()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/api_v2/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ var defaultReplicaConfig = &ReplicaConfig{
},
EncoderConcurrency: 16,
Terminator: "\r\n",
DateSeparator: "none",
DateSeparator: "day",
EnablePartitionSeparator: true,
},
Consistent: &ConsistentConfig{
Expand Down

0 comments on commit f926a1b

Please sign in to comment.