-
Notifications
You must be signed in to change notification settings - Fork 366
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
Feat/InfluxDB - Increase time precision to microseconds for timestamp fields #851
base: master
Are you sure you want to change the base?
Feat/InfluxDB - Increase time precision to microseconds for timestamp fields #851
Conversation
Hi, thanks for the pull request. However I do not believe it is necessary. I would have thought you should be able to achieve what you are looking to do by adding TIMESTAMPUNIT to the KCQL.
We would prefer to keep this user-configurable via KCQL than to have it hard-coded to a particular unit. Having looked at the documentation it does seem this is missing, so I will make a note to add this in the near future. |
006fc00
to
d1ed145
Compare
Thanks @davidsloan! Indeed I just tested the TIMESTAMPUNIT to specify the precision of the timestamp field and that worked, so I reverted the following:
But I'm still multiplying the My Scala is not good enough to make this more generic, but I think the idea is to use the TIMESTAMPUNIT value to multiply the Here's the connector configuration I've used with this PR
Can I get some help to make this more generic? I'll edit issue #850 to explain that TIMESTAMPUNIT is currently not working with |
Let me have a little more of a think, try a few scenarios and get back to you. My first thought is that maybe the TimestampConverter SMT could help here, as it is quite versatile. |
@davidsloan I was looking at TimestampConverter and looks like it cannot change the timestamp precision when writing Unix timestamps. I think the path forward is to use the TIMESTAMPUNIT information to multiply the double timestamp in seconds by the corresponding factor. I'm happy to discuss this idea further if needed. |
- For double timestamp fields, increase time precision from milliseconds to microseconds
- It is now coerced to Long with microseconds precision
d1ed145
to
c6f57bc
Compare
#626 assumes Unix timestamp in seconds if the type is double and coerce to Long in milliseconds. In this PR we increase the time precision to microseconds for timestamp fields.
I think a mechanism to set the time precision as proposed in #850 would be a better solution though.