-
Notifications
You must be signed in to change notification settings - Fork 137
Closed
Labels
Description
Describe the bug
field:
my_time DateTime64(3, 'UTC') CODEC(Delta, ZSTD),
struct:
max_time: chrono::DateTime<chrono::Utc>,
query:
select max(my_time) AS max_time from data_real;
table is empty
.fetch_optional(), .next() - everything returns an Err - Custom("premature end of input")
When I remove max - everything works;
When I query in clickhouse-client - it gives 1970-1-1
more details:
CREATE TABLE IF NOT EXISTS data_real (
my_time DateTime64(3, 'UTC') CODEC(Delta, ZSTD),
) ENGINE = MergeTree
ORDER BY my_time
#[derive(Row, Deserialize, Debug)]
pub struct LastTime {
max_time: chrono::DateTime<chrono::Utc>,
}
pub async fn get_last_id(&self) -> Option<LastTime> {
let q = r#"
SELECT
max(my_time) AS max_time
FROM data_real"#;
let q = self.client.query(q);
let mut s = q.fetch::<LastTime>().unwrap();
let y = s.next().await;
let y = y.unwrap(); // ---- panic here -----
y
}