Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sink(ticdc): set default value of DateSeparator to day(#8998) #9011

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
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
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,
EnableKafkaSinkV2: false,
},
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/sink/dmlsink/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 @@ -205,7 +205,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 @@ -59,7 +59,7 @@ var defaultReplicaConfig = &ReplicaConfig{
},
EncoderConcurrency: 16,
Terminator: CRLF,
DateSeparator: DateSeparatorNone.String(),
DateSeparator: DateSeparatorDay.String(),
EnablePartitionSeparator: true,
EnableKafkaSinkV2: false,
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 @@ -37,6 +37,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 @@ -129,7 +129,7 @@ var defaultReplicaConfig = &ReplicaConfig{
},
EncoderConcurrency: 16,
Terminator: "\r\n",
DateSeparator: "none",
DateSeparator: "day",
EnablePartitionSeparator: true,
},
Consistent: &ConsistentConfig{
Expand Down