diff --git a/internal/fusion/fusion.go b/internal/fusion/fusion.go index d921e0b..9068689 100644 --- a/internal/fusion/fusion.go +++ b/internal/fusion/fusion.go @@ -509,15 +509,15 @@ func resolveIssuedAtInBucket(db *sql.DB, stationID, provider string, bucketHour func loadForecastSamples(db *sql.DB, stationID, provider string, issued time.Time) ([]forecastSample, error) { const q = ` SELECT forecast_time, - rain_mm_x1000, - temp_c_x100, - humidity_pct, - wind_speed_ms_x1000, - wind_gust_ms_x1000, - wind_dir_deg, - precip_prob_pct, - pressure_hpa_x100, - uv_index + COALESCE(rain_mm_x1000, 0), + COALESCE(temp_c_x100, 0), + COALESCE(humidity_pct, 0), + COALESCE(wind_speed_ms_x1000, 0), + COALESCE(wind_gust_ms_x1000, 0), + COALESCE(wind_dir_deg, 0), + COALESCE(precip_prob_pct, 0), + COALESCE(pressure_hpa_x100, 0), + COALESCE(uv_index, 0) FROM forecast_hourly WHERE station_id=$1 AND provider=$2 AND issued_at=$3 ORDER BY forecast_time ASC`