Fix quantile overflow: wrap p99 query with toInt64() for JDBC compat
Some checks failed
CI / build (push) Successful in 1m11s
CI / docker (push) Has been cancelled
CI / deploy (push) Has been cancelled

quantile(0.99) returns Float64 which ClickHouse JDBC cannot cast to
Long directly. Same toInt64() pattern already used in timeseries query.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-13 22:42:52 +01:00
parent d4df47215b
commit f156a2aab0

View File

@@ -90,7 +90,7 @@ public class ClickHouseSearchEngine implements SearchEngine {
@Override
public ExecutionStats stats(Instant from, Instant to) {
Long p99 = jdbcTemplate.queryForObject(
"SELECT quantile(0.99)(duration_ms) FROM route_executions " +
"SELECT toInt64(quantile(0.99)(duration_ms)) FROM route_executions " +
"WHERE start_time >= ? AND start_time <= ?",
Long.class, Timestamp.from(from), Timestamp.from(to));
Long active = jdbcTemplate.queryForObject(