diff --git a/transform/sqlmesh_materia/models/foundation/fct_weather_daily.sql b/transform/sqlmesh_materia/models/foundation/fct_weather_daily.sql index 6595fd9..d1fb0d4 100644 --- a/transform/sqlmesh_materia/models/foundation/fct_weather_daily.sql +++ b/transform/sqlmesh_materia/models/foundation/fct_weather_daily.sql @@ -61,7 +61,7 @@ WITH src AS ( TRY_CAST(located.temperature_2m_max AS DOUBLE) > 35.0 AS is_heat_stress, COALESCE(TRY_CAST(located.precipitation_sum AS DOUBLE), 0.0) < 1.0 AS is_drought, TRY_CAST(located.vapour_pressure_deficit_max AS DOUBLE) > 1.5 AS is_high_vpd, - HASH(location_id, src."date") AS hkey, + HASH(location_id, located."date") AS hkey, filename FROM located WHERE diff --git a/transform/sqlmesh_materia/models/serving/obt_cot_positioning.sql b/transform/sqlmesh_materia/models/serving/obt_cot_positioning.sql index 9a94d62..73e9663 100644 --- a/transform/sqlmesh_materia/models/serving/obt_cot_positioning.sql +++ b/transform/sqlmesh_materia/models/serving/obt_cot_positioning.sql @@ -98,7 +98,50 @@ WITH latest_revision AS ( WINDOW w26 AS (ORDER BY report_date ROWS BETWEEN 25 PRECEDING AND CURRENT ROW), w52 AS (ORDER BY report_date ROWS BETWEEN 51 PRECEDING AND CURRENT ROW) ) SELECT - * + report_date, + market_and_exchange_name, + cftc_commodity_code, + cftc_contract_market_code, + contract_units, + ingest_date, + open_interest, + managed_money_long, + managed_money_short, + managed_money_spread, + managed_money_net, + prod_merc_long, + prod_merc_short, + prod_merc_net, + swap_long, + swap_short, + swap_spread, + swap_net, + other_reportable_long, + other_reportable_short, + other_reportable_spread, + other_reportable_net, + nonreportable_long, + nonreportable_short, + nonreportable_net, + managed_money_net_pct_of_oi, + managed_money_long_short_ratio, + change_open_interest, + change_managed_money_long, + change_managed_money_short, + change_managed_money_net, + change_prod_merc_long, + change_prod_merc_short, + managed_money_net_wow, + concentration_top4_long_pct, + concentration_top4_short_pct, + concentration_top8_long_pct, + concentration_top8_short_pct, + traders_total, + traders_managed_money_long, + traders_managed_money_short, + traders_managed_money_spread, + cot_index_26w, + cot_index_52w FROM with_derived ORDER BY report_date \ No newline at end of file