fix: use alias in ORDER BY for processor metrics query
ClickHouse rejects countMerge() in ORDER BY after GROUP BY because the column is already finalized to UInt64. Use the SELECT alias instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -164,7 +164,7 @@ public class RouteMetricsController {
|
||||
sql.append(" AND application_id = " + lit(appId));
|
||||
}
|
||||
sql.append(" GROUP BY processor_id, processor_type, route_id, application_id");
|
||||
sql.append(" ORDER BY countMerge(total_count) DESC");
|
||||
sql.append(" ORDER BY total_count DESC");
|
||||
|
||||
List<ProcessorMetrics> metrics = jdbc.query(sql.toString(), (rs, rowNum) -> {
|
||||
long totalCount = rs.getLong("total_count");
|
||||
|
||||
Reference in New Issue
Block a user