Skip to content

Commit

Permalink
chore: rename props with dot separation (#13656)
Browse files Browse the repository at this point in the history
  • Loading branch information
tabVersion authored Dec 7, 2023
1 parent d98546f commit 57cc9b9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/connector/src/source/kafka/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ pub struct KafkaProperties {
#[serde(rename = "scan.startup.mode", alias = "kafka.scan.startup.mode")]
pub scan_startup_mode: Option<String>,

#[serde(rename = "scan.startup.timestamp_millis", alias = "kafka.time.offset")]
#[serde(
rename = "scan.startup.timestamp.millis",
alias = "kafka.time.offset",
alias = "scan.startup.timestamp_millis" // keep for compatibility
)]
pub time_offset: Option<String>,

#[serde(rename = "properties.group.id", alias = "kafka.consumer.group")]
Expand Down
5 changes: 4 additions & 1 deletion src/connector/src/source/nats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ pub struct NatsProperties {
#[serde(rename = "scan.startup.mode")]
pub scan_startup_mode: Option<String>,

#[serde(rename = "scan.startup.timestamp_millis")]
#[serde(
rename = "scan.startup.timestamp.millis",
alias = "scan.startup.timestamp_millis"
)]
pub start_time: Option<String>,

#[serde(rename = "stream")]
Expand Down
6 changes: 5 additions & 1 deletion src/connector/src/source/pulsar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ pub struct PulsarProperties {
#[serde(rename = "scan.startup.mode", alias = "pulsar.scan.startup.mode")]
pub scan_startup_mode: Option<String>,

#[serde(rename = "scan.startup.timestamp_millis", alias = "pulsar.time.offset")]
#[serde(
rename = "scan.startup.timestamp.millis",
alias = "pulsar.time.offset",
alias = "scan.startup.timestamp_millis"
)]
pub time_offset: Option<String>,

#[serde(flatten)]
Expand Down
11 changes: 6 additions & 5 deletions src/connector/with_options_source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ KafkaProperties:
field_type: String
required: false
alias: kafka.scan.startup.mode
- name: scan.startup.timestamp_millis
- name: scan.startup.timestamp.millis
field_type: String
required: false
alias: kafka.time.offset
alias: scan.startup.timestamp_millis
- name: properties.group.id
field_type: String
required: false
Expand Down Expand Up @@ -219,9 +219,10 @@ NatsProperties:
- name: scan.startup.mode
field_type: String
required: false
- name: scan.startup.timestamp_millis
- name: scan.startup.timestamp.millis
field_type: String
required: false
alias: scan.startup.timestamp_millis
- name: stream
field_type: String
required: true
Expand Down Expand Up @@ -428,10 +429,10 @@ PulsarProperties:
field_type: String
required: false
alias: pulsar.scan.startup.mode
- name: scan.startup.timestamp_millis
- name: scan.startup.timestamp.millis
field_type: String
required: false
alias: pulsar.time.offset
alias: scan.startup.timestamp_millis
- name: topic
field_type: String
required: true
Expand Down

0 comments on commit 57cc9b9

Please sign in to comment.