Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TimestampConverter should have a config to define which precision to use when convert from and to Long epoch timestampsunix timestamp.

Currently, the Kafka Connect SMT TimestampConverter can convert Timestamp from multiples sources types (String, Long or Date) into different target types (String, Long or Date).

...

Add a config property epoch.precision,  defaultmillis for compatibility.which defaults tomillis for compatibility. Possible values: seconds, millis, micros, nanos.

Proposed Changes

New config property for TimestampConverter

Code Block
languageyml
"transforms.TimestampConverter.type": "org.apache.kafka.connect.transforms.TimestampConverter$Value",
"transforms.TimestampConverter.field": "event_date_long",
"transforms.TimestampConverter.epoch.precision": "micros",
"transforms.TimestampConverter.target.type": "Timestamp"

int32 and seconds

Since int32 should not be used for timestamp, obsolete systems Systems that produces int32 into Kafka and want should willingly chain Cast SMT and then TimestampConverter SMT if they want to use this feature.

...