-
Notifications
You must be signed in to change notification settings - Fork 29
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
Pillar eats up milliseconds #72
Comments
Actually, we know why it happens. It is because of this: And we what to know the reasoning behind this code. It is unclear why you decided to drop milliseconds. |
The answer is quite simple, the DateTime64 type was added to clickhouse later than the convert function in this library. https://github.com/balance-platform/pillar/blob/master/lib/pillar/type_convert/to_clickhouse.ex#L40 (March 2020) What workaround I can suggest:
For Example: Pillar.query(conn,
"INSERT INTO table (id, created_at) SELECT {id}, {created_at}",
%{id: 123, created_at: %Pillar.Arg{value: DateTime.utc_now(), target_type: :DateTime64}
) |
Ok, thank you. We did number 1 and it works for us. However, may be it is time to change something in pillar ) |
Okay, glad it helped! We are not actively using clickhouse right now, so the library is not actively developing. In any case, we do not refuse support, if there are people willing to contribute, we will help, merge and publish an updated version on hex) |
ok, got it |
Greetings!
We encountered unexpected behavior. The data type DateTime64 allows milliseconds, but Pillar rounds it to seconds.
For example input data:
In ClickHouse it saved like:
There are may be a reason for this behavior. Can you explain why it works this way?
We have problem to build pagination based on date when we insert more than 1 records per second.
The text was updated successfully, but these errors were encountered: