-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(clickhouse sink): Add encoding.timestamp_format
field
#1634
Conversation
Also for now I've implemented this as an enum in case we wish to add more formats later, but I'm also not convinced there's any reason not to use |
After having a moment to think about it I think the right course is to have a boolean flag |
I think I agree. A few questions:
|
If we can tie this into encoding options in my view that's the more "user empowering" way, it also makes the behavior clearer. Also yes on it applying to all timestamps. Do we want to wait for the encoding work to be fully specced out, or add a field for this sink in the interim? If we add |
I wonder how could we, maybe in subsequent PRs, also make it possible to either
These are two options frequently recommended to be used in ClickHouse for use cases where sub-second precision is needed. Also, some people might want to store, for example, milliseconds instead of nanoseconds. |
Is there anything holding up this PR? |
We ought to expand the behavior so that all timestamp fields are encoded according to this setting, and not just the standard timestamp field. But other than that I think we can add this in without aggro. |
Signed-off-by: Ashley Jeffs <ash@jeffail.uk>
I agree with @Jeffail. Can we go with an If possible, I'd like to get this in 0.8.0 for one of our important users. |
142e5b6
to
4f6d794
Compare
Signed-off-by: Ashley Jeffs <ash@jeffail.uk>
4f6d794
to
942c2d2
Compare
Okay so for now I've:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Looks good to me.
encoding.timestamp_format
field
Allows users to specify a format for
timestamp
such that it can be parsed by Clickhouse as aDateTime
data type.By default we're not applying any formatting (sending as a string), this preserves backwards compatibility, it's also not an entirely unfavorable behavior since it has a higher precision. However, it's worth considering making
unix
formatting the default behavior here instead.Closes #1443