Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
Description
Currently, the SMT TimestampConverter can convert Timestamp from either source String, Long or Date into target String, Long or Date.
The problem is that Long source or target is required to be epoch in milliseconds.
In many cases, epoch is represented with different precisions. This leads to several Jira tickets :
I propose to add a new config to TimestampConverter called "epoch.precision" which defaults to "millis" so as to not impact existing code, and allows for more precisions : seconds, millis, micros.
"transforms": "TimestampConverter", "transforms.TimestampConverter.type": "org.apache.kafka.connect.transforms.TimestampConverter$Value", "transforms.TimestampConverter.field": "event_date", "transforms.TimestampConverter.epoch.precision": "micros", "transforms.TimestampConverter.target.type": "Timestamp"
Exactly like "format" field which is used as input when the source in String and output when the target.type is string, this new field would be used as input when the field is Long, and as output when the target.type is "unix"