Open prk3 opened 3 years ago
Hi! It's a bug in clickhouse-rs. Fix has already been pushed in this repository, and it will be in the next release.
Hey, has this fix been released?
I see it isn't, I've tried the same workaround as @prk3, and got the exact same panic... 😞
I also tried to use the latest source here, directly from github's async-await
branch, which is the default, but it is also breaks with error: failed to select a version for 'pin-project'
.
Can you please help?
Still got this error.
😞
It's example witch show that code above work without any errors. Could you please give me an example that reproduces this error?
@prk3 explained it perfectly in the original post, the error is with DateTime64, not the 32 your example uses. Thanks.
Actual, no. It creates a column of Chrono
which will be cast to DateTime64
.
dbg!(b.get_column("date").unwrap().sql_type()); // prints DateTime(Chrono)
Not with the released version on crates "1.0.0-alpha.1". I get this:
[src/tasks/clickhouse_pusher.rs:52] b.get_column("date").unwrap().sql_type() = DateTime(
DateTime32,
)
Error in clickhouse pusher: From SQL error: `SqlType::DateTime cannot be cast to DateTime64(9, 'UTC').`
Caused by:
SqlType::DateTime cannot be cast to DateTime64(9, 'UTC').
Fix has already been pushed in this repository, and it will be in the next release.
Perhaps you forgot to release it? You don't release it in more than one and a half years.
PS.: I even tried directly with the github's async-await
branch, which is the default, but I couldn't make it compile.
It breaks with the error: failed to select a version for 'pin-project'
.
The above pin
error was a few months ago.
I just tried it again now, and it doesn't compile again, for a different reason:
PS.: The code it was trying to compile is exactly your Datetime example.
Wow, I found it!
chrono-tz = "0.5"
was the culprit. It did work now with 0.6!!
Well, I would still prefer to use a released version, otherwise, I'll need to pin the specific commit in your repo. But OK, thank you.
Hi! I have trouble inserting DateTime64 values into a table that looks like this:
The following code produces an error (runtime error):
Here is the error:
As far as I understand, it says that clickhouse expected DateTime64 and received DateTime. I tried indicating that I want DateTime64 with
clickhouse_rs::Value::DateTime64
:But that causes a panic:
I found a workaround: inserting columns, not rows.
Is this a bug or am I using raw! macro wrong? What's the intended way of passing DateTime64 to row?