File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
internal/server/postgres/sql/queries Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ ORDER BY rp.target_time_utc ASC;
245245 * Predicted values are 16-bit integers, with 0 representing 0% and 30000 representing 100% of capacity.
246246 */
247247WITH relevant_forecasts AS (
248- SELECT
248+ SELECT DISTINCT ON ( f . geometry_uuid )
249249 f .forecast_uuid ,
250250 f .geometry_uuid ,
251251 f .source_type_id ,
@@ -256,13 +256,13 @@ WITH relevant_forecasts AS (
256256 AND f .source_type_id = $1
257257 AND f .forecaster_id = $2
258258 AND f .target_period @> sqlc .arg (target_timestamp_utc)::TIMESTAMP
259+ ORDER BY f .geometry_uuid , f .init_time_utc
259260),
260261ranked_predictions AS (
261262 SELECT
262263 rf .forecast_uuid ,
263264 rf .geometry_uuid ,
264265 rf .source_type_id ,
265- rf .init_time_utc ,
266266 pg .horizon_mins ,
267267 pg .p50_sip ,
268268 pg .target_time_utc ,
You can’t perform that action at this time.
0 commit comments