From 27aa930be9ba088a5cc2d3f90a586c5b103c15ee Mon Sep 17 00:00:00 2001 From: Charles Costanzo Date: Mon, 16 Dec 2024 19:18:14 -0500 Subject: [PATCH 1/6] add explicit column names for staging ntd annual tables --- .../staging/ntd_annual_reporting/_src.yml | 2 +- .../stg_ntd__2023_agency_information.sql | 49 ++++++++- ...tg_ntd__2023_contractual_relationships.sql | 35 +++++- .../stg_ntd__breakdowns.sql | 35 +++++- .../stg_ntd__breakdowns_by_agency.sql | 30 +++++- ...g_ntd__capital_expenses_by_capital_use.sql | 44 +++++++- .../stg_ntd__capital_expenses_by_mode.sql | 40 ++++++- ..._capital_expenses_for_existing_service.sql | 29 ++++- ...ital_expenses_for_expansion_of_service.sql | 29 ++++- .../stg_ntd__employees_by_agency.sql | 32 +++++- .../stg_ntd__employees_by_mode.sql | 25 ++++- ...d__employees_by_mode_and_employee_type.sql | 45 +++++++- .../stg_ntd__fuel_and_energy.sql | 71 +++++++++++- .../stg_ntd__fuel_and_energy_by_agency.sql | 36 ++++++- ...g_ntd__funding_sources_by_expense_type.sql | 30 +++++- ...td__funding_sources_directly_generated.sql | 31 +++++- .../stg_ntd__funding_sources_federal.sql | 24 ++++- .../stg_ntd__funding_sources_local.sql | 27 ++++- .../stg_ntd__funding_sources_state.sql | 22 +++- ...funding_sources_taxes_levied_by_agency.sql | 25 ++++- .../stg_ntd__maintenance_facilities.sql | 45 +++++++- ..._ntd__maintenance_facilities_by_agency.sql | 29 ++++- .../ntd_annual_reporting/stg_ntd__metrics.sql | 45 +++++++- ...tg_ntd__operating_expenses_by_function.sql | 35 +++++- ...rating_expenses_by_function_and_agency.sql | 24 ++++- .../stg_ntd__operating_expenses_by_type.sql | 55 +++++++++- ..._operating_expenses_by_type_and_agency.sql | 34 +++++- .../stg_ntd__service_by_agency.sql | 41 ++++++- .../stg_ntd__service_by_mode.sql | 52 ++++++++- ...g_ntd__service_by_mode_and_time_period.sql | 75 ++++++++++++- ...facilities_by_agency_and_facility_type.sql | 43 +++++++- .../stg_ntd__stations_by_mode_and_age.sql | 31 +++++- .../stg_ntd__track_and_roadway_by_agency.sql | 38 ++++++- .../stg_ntd__track_and_roadway_by_mode.sql | 62 ++++++++++- .../stg_ntd__vehicles_age_distribution.sql | 40 ++++++- ...stg_ntd__vehicles_type_count_by_agency.sql | 102 +++++++++++++++++- 36 files changed, 1340 insertions(+), 72 deletions(-) diff --git a/warehouse/models/staging/ntd_annual_reporting/_src.yml b/warehouse/models/staging/ntd_annual_reporting/_src.yml index 8a095aac8e..7ec62c8173 100644 --- a/warehouse/models/staging/ntd_annual_reporting/_src.yml +++ b/warehouse/models/staging/ntd_annual_reporting/_src.yml @@ -502,4 +502,4 @@ sources: - name: multi_year__vehicles_age_distribution - name: multi_year__vehicles_type_count_by_agency - name: 2023__annual_database_agency_information - - name: 2023__annual_database_contractual_relationship + - name: 2023__annual_database_contractual_relationships diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_agency_information.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_agency_information.sql index 4d1d3d74ac..829288fec3 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_agency_information.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_agency_information.sql @@ -4,7 +4,6 @@ WITH external_agency_information AS ( ), get_latest_extract AS( - SELECT * FROM external_agency_information -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,50 @@ stg_ntd__2023_agency_information AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__2023_agency_information +SELECT + number_of_state_counties, + tam_tier, + personal_vehicles, + uza_name, + tribal_area_name, + service_area_sq_miles, + voms_do, + url, + region, + state_admin_funds_expended, + zip_code_ext, + zip_code, + ueid, + address_line_2, + number_of_counties_with_service, + reporter_acronym, + original_due_date, + sq_miles, + address_line_1, + p_o__box, + division_department, + fy_end_date, + service_area_pop, + state, + subrecipient_type, + primary_uza_uace_code, + reported_by_name, + population, + reporting_module, + volunteer_drivers, + doing_business_as, + reporter_type, + legacy_ntd_id, + total_voms, + fta_recipient_id, + city, + voms_pt, + organization_type, + agency_name, + ntd_id, + reported_by_ntd_id, + density, + state_parent_ntd_id, + dt, + execution_ts +FROM stg_ntd__2023_agency_information diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_contractual_relationships.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_contractual_relationships.sql index 9c77c06993..9445e89dc9 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_contractual_relationships.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__2023_contractual_relationships.sql @@ -1,10 +1,9 @@ WITH external_contractual_relationships AS ( SELECT * - FROM {{ source('external_ntd__annual_reporting', '2023__annual_database_contractual_relationship') }} + FROM {{ source('external_ntd__annual_reporting', '2023__annual_database_contractual_relationships') }} ), get_latest_extract AS( - SELECT * FROM external_contractual_relationships -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,34 @@ stg_ntd__2023_contractual_relationships AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__2023_contractual_relationships +SELECT + other_reconciling_item_expenses_incurred_by_the_buyer, + total_modal_expenses, + contract_capital_leasing_expenses, + direct_payment_agency_subsidy, + months_seller_operated_in_fy, + primary_feature, + voms_under_contract, + service_captured, + fares_retained_by, + other_party, + other_public_assets_provided, + buyer_supplies_vehicles_to_seller, + contractee_ntd_id, + pt_fare_revenues_passenger_fees, + agency_name, + tos, + type_of_contract, + reporter_contractual_position, + other_operating_expenses_incurred_by_the_buyer, + passenger_out_of_pocket_expenses, + buyer_provides_maintenance_facility_to_seller, + contractee_operator_name, + mode, + reporting_module, + reporter_type, + other_public_assets_provided_desc, + ntd_id, + dt, + execution_ts +FROM stg_ntd__2023_contractual_relationships diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns.sql index 4b136f7fcf..7c37b8a2d5 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns.sql @@ -4,7 +4,6 @@ WITH external_breakdowns AS ( ), get_latest_extract AS( - SELECT * FROM external_breakdowns -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,36 @@ stg_ntd__breakdowns AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__breakdowns +SELECT + agency, + agency_voms, + city, + major_mechanical_failures, + major_mechanical_failures_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + other_mechanical_failures, + other_mechanical_failures_1, + primary_uza_population, + report_year, + reporter_type, + state, + total_mechanical_failures, + total_mechanical_failures_1, + train_miles, + train_miles_questionable, + train_revenue_miles, + train_revenue_miles_1, + type_of_service, + uace_code, + uza_name, + vehicle_passenger_car_miles, + vehicle_passenger_car_miles_1, + vehicle_passenger_car_miles_2, + vehicle_passenger_car_revenue, + dt, + execution_ts +FROM stg_ntd__breakdowns diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns_by_agency.sql index 07339ea24e..d7e733b570 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__breakdowns_by_agency.sql @@ -4,7 +4,6 @@ WITH external_breakdowns_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_breakdowns_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,31 @@ stg_ntd__breakdowns_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__breakdowns_by_agency +SELECT + count_major_mechanical_failures_questionable, + count_other_mechanical_failures_questionable, + count_total_mechanical_failures_questionable, + count_train_miles_questionable, + count_train_revenue_miles_questionable, + count_vehicle_passenger_car_miles_questionable, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_major_mechanical_failures, + sum_other_mechanical_failures, + sum_total_mechanical_failures, + sum_train_miles, + sum_train_revenue_miles, + sum_vehicle_passenger_car_miles, + sum_vehicle_passenger_car_revenue, + dt, + execution_ts +FROM stg_ntd__breakdowns_by_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_capital_use.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_capital_use.sql index dbeeb9716a..4c683afb05 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_capital_use.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_capital_use.sql @@ -4,7 +4,6 @@ WITH external_capital_expenses_by_capital_use AS ( ), get_latest_extract AS( - SELECT * FROM external_capital_expenses_by_capital_use -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,45 @@ stg_ntd__capital_expenses_by_capital_use AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__capital_expenses_by_capital_use +SELECT + administrative_buildings, + administrative_buildings_1, + agency, + agency_voms, + city, + communication_information, + communication_information_1, + fare_collection_equipment, + fare_collection_equipment_1, + form_type, + guideway, + guideway_questionable, + maintenance_buildings, + maintenance_buildings_1, + mode_name, + mode_voms, + modecd, + ntd_id, + organization_type, + other, + other_questionable, + other_vehicles, + other_vehicles_questionable, + passenger_vehicles, + passenger_vehicles_1, + primary_uza_population, + reduced_reporter, + reduced_reporter_questionable, + report_year, + reporter_type, + state, + stations, + stations_questionable, + total, + total_questionable, + typeofservicecd, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__capital_expenses_by_capital_use diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_mode.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_mode.sql index 8773964a29..3aa5a0dd0a 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_mode.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_by_mode.sql @@ -4,7 +4,6 @@ WITH external_capital_expenses_by_mode AS ( ), get_latest_extract AS( - SELECT * FROM external_capital_expenses_by_mode -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,41 @@ stg_ntd__capital_expenses_by_mode AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__capital_expenses_by_mode +SELECT + count_administrative_buildings_q, + count_communication_information_q, + count_fare_collection_equipment_q, + count_maintenance_buildings_q, + count_other_q, + count_other_vehicles_q, + count_passenger_vehicles_q, + count_reduced_reporter_q, + count_stations_q, + max_agency, + max_agency_voms, + max_city, + max_mode_name, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + modecd, + ntd_id, + report_year, + sum_administrative_buildings, + sum_communication_information, + sum_fare_collection_equipment, + sum_guideway, + sum_maintenance_buildings, + sum_other, + sum_other_vehicles, + sum_passenger_vehicles, + sum_reduced_reporter, + sum_stations, + sum_total, + typeofservicecd, + dt, + execution_ts +FROM stg_ntd__capital_expenses_by_mode diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_existing_service.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_existing_service.sql index 9988dfe7db..cefd31ef36 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_existing_service.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_existing_service.sql @@ -4,7 +4,6 @@ WITH external_capital_expenses_for_existing_service AS ( ), get_latest_extract AS( - SELECT * FROM external_capital_expenses_for_existing_service -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,30 @@ stg_ntd__capital_expenses_for_existing_service AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__capital_expenses_for_existing_service +SELECT + form_type, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_administrative_buildings, + sum_communication_information, + sum_fare_collection_equipment, + sum_guideway, + sum_maintenance_buildings, + sum_other, + sum_other_vehicles, + sum_passenger_vehicles, + sum_reduced_reporter, + sum_stations, + sum_total, + dt, + execution_ts +FROM stg_ntd__capital_expenses_for_existing_service diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_expansion_of_service.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_expansion_of_service.sql index 2019b657a5..1ac268ce9f 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_expansion_of_service.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__capital_expenses_for_expansion_of_service.sql @@ -4,7 +4,6 @@ WITH external_capital_expenses_for_expansion_of_service AS ( ), get_latest_extract AS( - SELECT * FROM external_capital_expenses_for_expansion_of_service -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,30 @@ stg_ntd__capital_expenses_for_expansion_of_service AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__capital_expenses_for_expansion_of_service +SELECT + form_type, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_administrative_buildings, + sum_communication_information, + sum_fare_collection_equipment, + sum_guideway, + sum_maintenance_buildings, + sum_other, + sum_other_vehicles, + sum_passenger_vehicles, + sum_reduced_reporter, + sum_stations, + sum_total, + dt, + execution_ts +FROM stg_ntd__capital_expenses_for_expansion_of_service diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_agency.sql index 60945f6972..2046edb1e3 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_agency.sql @@ -4,7 +4,6 @@ WITH external_employees_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_employees_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,33 @@ stg_ntd__employees_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__employees_by_agency +SELECT + agency, + avgwagerate, + count_capital_labor_count_q, + count_capital_labor_hours_q, + count_facility_maintenance_count_q, + count_facility_maintenance_hours_q, + count_general_administration_count_q, + count_general_administration_hours_q, + count_total_employee_count_q, + count_total_employee_hours_q, + count_vehicle_maintenance_count_q, + count_vehicle_maintenance_hours_q, + count_vehicle_operations_count_q, + count_vehicle_operations_hours_q, + max_agency_voms_1, + max_city_1, + max_mode_voms, + max_ntd_id, + max_primary_uza_population_1, + max_state_1, + max_uza_name_1, + report_year, + sum_total_hours, + total_employees, + total_operating_hours, + total_salaries, + dt, + execution_ts +FROM stg_ntd__employees_by_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode.sql index d015e350cb..471bff2116 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode.sql @@ -4,7 +4,6 @@ WITH external_employees_by_mode AS ( ), get_latest_extract AS( - SELECT * FROM external_employees_by_mode -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,26 @@ stg_ntd__employees_by_mode AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__employees_by_mode +SELECT + count_capital_labor_count_q, + count_capital_labor_hours_q, + count_facility_maintenance_count_q, + count_facility_maintenance_hours_q, + count_general_administration_count_q, + count_general_administration_hours_q, + count_total_employee_count_q, + count_total_employee_hours_q, + count_vehicle_maintenance_count_q, + count_vehicle_maintenance_hours_q, + count_vehicle_operations_count_q, + count_vehicle_operations_hours_q, + max_mode_name, + mode, + ntd_id, + report_year, + sum_total_employee_count, + sum_total_hours, + type_of_service, + dt, + execution_ts +FROM stg_ntd__employees_by_mode diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode_and_employee_type.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode_and_employee_type.sql index bc9549a639..ecf005d2c0 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode_and_employee_type.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__employees_by_mode_and_employee_type.sql @@ -4,7 +4,6 @@ WITH external_employees_by_mode_and_employee_type AS ( ), get_latest_extract AS( - SELECT * FROM external_employees_by_mode_and_employee_type -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,46 @@ stg_ntd__employees_by_mode_and_employee_type AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__employees_by_mode_and_employee_type +SELECT + agency, + agency_voms, + capital_labor_count, + capital_labor_count_q, + capital_labor_hours, + capital_labor_hours_q, + city, + facility_maintenance_count, + facility_maintenance_count_q, + facility_maintenance_hours, + facility_maintenance_hours_q, + full_or_part_time, + general_administration_count, + general_administration_count_q, + general_administration_hours, + general_administration_hours_q, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + primary_uza_population, + report_year, + state, + total_employee_count, + total_employee_count_q, + total_hours, + total_hours_q, + type_of_service, + uace_code, + uza_name, + vehicle_maintenance_count, + vehicle_maintenance_count_q, + vehicle_maintenance_hours, + vehicle_maintenance_hours_q, + vehicle_operations_count, + vehicle_operations_count_q, + vehicle_operations_hours, + vehicle_operations_hours_q, + dt, + execution_ts +FROM stg_ntd__employees_by_mode_and_employee_type diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy.sql index 72e129fdc7..9d8a9a30af 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy.sql @@ -4,7 +4,6 @@ WITH external_fuel_and_energy AS ( ), get_latest_extract AS( - SELECT * FROM external_fuel_and_energy -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,72 @@ stg_ntd__fuel_and_energy AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__fuel_and_energy +SELECT + agency, + agency_voms, + bio_diesel_gal, + bio_diesel_gal_questionable, + city, + compressed_natural_gas, + compressed_natural_gas_mpg, + compressed_natural_gas_mpg_1, + compressed_natural_gas_1, + compressed_natural_gas_gal, + compressed_natural_gas_gal_1, + diesel, + diesel_questionable, + diesel_gal, + diesel_gal_questionable, + diesel_mpg, + diesel_mpg_questionable, + electric_battery, + electric_battery_questionable, + electric_battery_kwh, + electric_battery_kwh_1, + electric_battery_mi_kwh, + electric_battery_mi_kwh_1, + electric_propulsion, + electric_propulsion_1, + electric_propulsion_kwh, + electric_propulsion_kwh_1, + electric_propulsion_mi_kwh, + electric_propulsion_mi_kwh_1, + gasoline, + gasoline_mpg, + gasoline_mpg_questionable, + gasoline_questionable, + gasoline_gal, + gasoline_gal_questionable, + hydrogen, + hydrogen_mpkg_, + hydrogen_mpkg_questionable, + hydrogen_questionable, + hydrogen_kg_, + hydrogen_kg_questionable, + liquefied_petroleum_gas, + liquefied_petroleum_gas_mpg, + liquefied_petroleum_gas_mpg_1, + liquefied_petroleum_gas_1, + liquefied_petroleum_gas_gal, + liquefied_petroleum_gas_gal_1, + mode_name, + mode_voms, + modecd, + ntd_id, + organization_type, + other_fuel, + other_fuel_mpg, + other_fuel_mpg_questionable, + other_fuel_questionable, + other_fuel_gal_gal_equivalent, + other_fuel_gal_gal_equivalent_1, + primary_uza_population, + report_year, + reporter_type, + state, + typeofservicecd, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__fuel_and_energy diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy_by_agency.sql index 47b1e6a264..b2a135bddd 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__fuel_and_energy_by_agency.sql @@ -4,7 +4,6 @@ WITH external_fuel_and_energy_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_fuel_and_energy_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,37 @@ stg_ntd__fuel_and_energy_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__fuel_and_energy_by_agency +SELECT + diesel_gal_questionable, + diesel_mpg_questionable, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_bio_diesel_gal, + sum_compressed_natural_gas, + sum_compressed_natural_gas_gal, + sum_diesel, + sum_diesel_gal, + sum_electric_battery, + sum_electric_battery_kwh, + sum_electric_propulsion, + sum_electric_propulsion_kwh, + sum_gasoline, + sum_gasoline_gal, + sum_hydrogen, + sum_hydrogen_kg_, + sum_liquefied_petroleum_gas, + sum_liquefied_petroleum_gas_gal, + sum_other_fuel, + sum_other_fuel_gal_gal_equivalent, + dt, + execution_ts +FROM stg_ntd__fuel_and_energy_by_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_by_expense_type.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_by_expense_type.sql index af762164d5..1dab72b246 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_by_expense_type.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_by_expense_type.sql @@ -4,7 +4,6 @@ WITH external_funding_sources_by_expense_type AS ( ), get_latest_extract AS( - SELECT * FROM external_funding_sources_by_expense_type -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,31 @@ stg_ntd__funding_sources_by_expense_type AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__funding_sources_by_expense_type +SELECT + agency, + agency_voms, + city, + fares_and_other_directly, + fares_and_other_directly_1, + federal, + federal_questionable, + fund_expenditure_type, + local, + local_questionable, + ntd_id, + organization_type, + primary_uza_population, + report_year, + reporter_type, + state, + state_1, + state_questionable, + taxes_fees_levied_by_transit, + taxes_fees_levied_by_transit_1, + total, + total_questionable, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__funding_sources_by_expense_type diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_directly_generated.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_directly_generated.sql index 129334f7ad..b4aa649a13 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_directly_generated.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_directly_generated.sql @@ -4,7 +4,6 @@ WITH external_funding_sources_directly_generated AS ( ), get_latest_extract AS( - SELECT * FROM external_funding_sources_directly_generated -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,32 @@ stg_ntd__funding_sources_directly_generated AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__funding_sources_directly_generated +SELECT + advertising, + advertising_questionable, + agency, + agency_voms, + city, + concessions, + concessions_questionable, + fares, + fares_questionable, + ntd_id, + organization_type, + other, + other_questionable, + park_and_ride, + park_and_ride_questionable, + primary_uza_population, + purchased_transportation, + purchased_transportation_1, + report_year, + reporter_type, + state, + total, + total_questionable, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__funding_sources_directly_generated diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_federal.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_federal.sql index 18a8d22b9c..90b3fc1b0d 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_federal.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_federal.sql @@ -4,7 +4,6 @@ WITH external_funding_sources_federal AS ( ), get_latest_extract AS( - SELECT * FROM external_funding_sources_federal -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,25 @@ stg_ntd__funding_sources_federal AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__funding_sources_federal +SELECT + agency, + agency_voms, + city, + fta_capital_program_5309, + fta_rural_progam_5311, + fta_urbanized_area_formula, + ntd_id, + organization_type, + other_dot_funds, + other_federal_funds, + other_fta_funds, + primary_uza_population, + report_year, + reporter_type, + state, + total_federal_funds, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__funding_sources_federal diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_local.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_local.sql index 33fb55eb4b..ce7b8f1a57 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_local.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_local.sql @@ -4,7 +4,6 @@ WITH external_funding_sources_local AS ( ), get_latest_extract AS( - SELECT * FROM external_funding_sources_local -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,28 @@ stg_ntd__funding_sources_local AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__funding_sources_local +SELECT + agency, + agency_voms, + city, + fuel_tax, + general_fund, + income_tax, + ntd_id, + organization_type, + other_funds, + other_taxes, + primary_uza_population, + property_tax, + reduced_reporter_funds, + report_year, + reporter_type, + sales_tax, + state, + tolls, + total, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__funding_sources_local diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_state.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_state.sql index 8875fbb968..fd212f2ee7 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_state.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_state.sql @@ -4,7 +4,6 @@ WITH external_funding_sources_state AS ( ), get_latest_extract AS( - SELECT * FROM external_funding_sources_state -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,23 @@ stg_ntd__funding_sources_state AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__funding_sources_state +SELECT + agency, + agency_voms, + city, + general_funds, + ntd_id, + organization_type, + primary_uza_population, + reduced_reporter_funds, + report_year, + reporter_type, + state, + total, + total_questionable, + transportation_funds, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__funding_sources_state diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_taxes_levied_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_taxes_levied_by_agency.sql index e83a0c5f5c..b2f284e794 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_taxes_levied_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__funding_sources_taxes_levied_by_agency.sql @@ -4,7 +4,6 @@ WITH external_funding_sources_taxes_levied_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_funding_sources_taxes_levied_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,26 @@ stg_ntd__funding_sources_taxes_levied_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__funding_sources_taxes_levied_by_agency +SELECT + agency, + agency_voms, + city, + fuel_tax, + income_tax, + ntd_id, + organization_type, + other_funds, + other_tax, + primary_uza_population, + property_tax, + report_year, + reporter_type, + sales_tax, + state, + tolls, + total, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__funding_sources_taxes_levied_by_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities.sql index 100c3e24f2..ae68322486 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities.sql @@ -4,7 +4,6 @@ WITH external_maintenance_facilities AS ( ), get_latest_extract AS( - SELECT * FROM external_maintenance_facilities -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,46 @@ stg_ntd__maintenance_facilities AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__maintenance_facilities +SELECT + _200_to_300_vehicles, + _200_to_300_vehicles_1, + agency, + agency_voms, + city, + heavy_maintenance_facilities, + heavy_maintenance_facilities_1, + leased_by_pt_provider, + leased_by_pt_provider_1, + leased_by_public_agency, + leased_by_public_agency_1, + leased_from_a_private_entity, + leased_from_a_private_entity_1, + leased_from_a_public_entity, + leased_from_a_public_entity_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + over_300_vehicles, + over_300_vehicles_questionable, + owned, + owned_questionable, + owned_by_pt_provider, + owned_by_pt_provider_1, + owned_by_public_agency, + owned_by_public_agency_1, + primary_uza_population, + report_year, + reporter_type, + state, + total_facilities, + total_maintenance_facilities, + type_of_service, + uace_code, + under_200_vehicles, + under_200_vehicles_1, + uza_name, + dt, + execution_ts +FROM stg_ntd__maintenance_facilities diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities_by_agency.sql index c4705317f9..a84ea96cc8 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__maintenance_facilities_by_agency.sql @@ -4,7 +4,6 @@ WITH external_maintenance_facilities_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_maintenance_facilities_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,30 @@ stg_ntd__maintenance_facilities_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__maintenance_facilities_by_agency +SELECT + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_200_to_300_vehicles, + sum_heavy_maintenance_facilities, + sum_leased_by_pt_provider, + sum_leased_by_public_agency, + sum_leased_from_a_private_entity, + sum_leased_from_a_public_entity, + sum_over_300_vehicles, + sum_owned, + sum_owned_by_pt_provider, + sum_owned_by_public_agency, + sum_total_facilities, + sum_under_200_vehicles, + dt, + execution_ts +FROM stg_ntd__maintenance_facilities_by_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__metrics.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__metrics.sql index 1204959d48..93b199eb15 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__metrics.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__metrics.sql @@ -4,7 +4,6 @@ WITH external_metrics AS ( ), get_latest_extract AS( - SELECT * FROM external_metrics -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,46 @@ stg_ntd__metrics AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__metrics +SELECT + agency, + agency_voms, + city, + cost_per_hour, + cost_per_hour_questionable, + cost_per_passenger, + cost_per_passenger_1, + cost_per_passenger_mile, + cost_per_passenger_mile_1, + fare_revenues_earned, + fare_revenues_earned_1, + fare_revenues_per_total, + fare_revenues_per_total_1, + fare_revenues_per_unlinked, + fare_revenues_per_unlinked_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + passenger_miles, + passenger_miles_questionable, + passengers_per_hour, + passengers_per_hour_1, + primary_uza_population, + report_year, + reporter_type, + state, + total_operating_expenses, + total_operating_expenses_1, + type_of_service, + unlinked_passenger_trips, + unlinked_passenger_trips_1, + vehicle_revenue_hours, + vehicle_revenue_hours_1, + vehicle_revenue_miles, + vehicle_revenue_miles_1, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__metrics diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function.sql index 4b1b953b58..4375c347f7 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function.sql @@ -4,7 +4,6 @@ WITH external_operating_expenses_by_function AS ( ), get_latest_extract AS( - SELECT * FROM external_operating_expenses_by_function -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,36 @@ stg_ntd__operating_expenses_by_function AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__operating_expenses_by_function +SELECT + agency, + agency_voms, + city, + facility_maintenance, + facility_maintenance_1, + general_administration, + general_administration_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + primary_uza_population, + reduced_reporter_expenses, + reduced_reporter_expenses_1, + report_year, + reporter_type, + separate_report_amount, + separate_report_amount_1, + state, + total, + total_questionable, + type_of_service, + vehicle_maintenance, + vehicle_maintenance_1, + vehicle_operations, + vehicle_operations_1, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__operating_expenses_by_function diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function_and_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function_and_agency.sql index 59e09a72b4..fbe3875ae3 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function_and_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_function_and_agency.sql @@ -4,7 +4,6 @@ WITH external_operating_expenses_by_function_and_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_operating_expenses_by_function_and_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,25 @@ stg_ntd__operating_expenses_by_function_and_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__operating_expenses_by_function_and_agency +SELECT + agency, + city, + max_agency_voms, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + state, + sum_facility_maintenance, + sum_general_administration, + sum_reduced_reporter_expenses, + sum_separate_report_amount, + sum_vehicle_maintenance, + sum_vehicle_operations, + total, + dt, + execution_ts +FROM stg_ntd__operating_expenses_by_function_and_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type.sql index 0b1209ce68..bb09c4310e 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type.sql @@ -4,7 +4,6 @@ WITH external_operating_expenses_by_type AS ( ), get_latest_extract AS( - SELECT * FROM external_operating_expenses_by_type -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,56 @@ stg_ntd__operating_expenses_by_type AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__operating_expenses_by_type +SELECT + agency, + agency_voms, + casualty_and_liability, + casualty_and_liability_1, + city, + fringe_benefits, + fringe_benefits_questionable, + fuel_and_lube, + fuel_and_lube_questionable, + miscellaneous, + miscellaneous_questionable, + mode, + mode_name, + mode_voms, + ntd_id, + operator_paid_absences, + operator_paid_absences_1, + operators_wages, + operators_wages_questionable, + organization_type, + other_materials_supplies, + other_materials_supplies_1, + other_paid_absences, + other_paid_absences_1, + other_salaries_wages, + other_salaries_wages_1, + primary_uza_population, + purchased_transportation, + purchased_transportation_1, + reduced_reporter_expenses, + reduced_reporter_expenses_1, + report_year, + reporter_type, + separate_report_amount, + separate_report_amount_1, + services, + services_questionable, + state, + taxes, + taxes_questionable, + tires, + tires_questionable, + total, + total_questionable, + type_of_service, + uace_code, + utilities, + utilities_questionable, + uza_name, + dt, + execution_ts +FROM stg_ntd__operating_expenses_by_type diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type_and_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type_and_agency.sql index 1657559373..ed2ee7d9ef 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type_and_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__operating_expenses_by_type_and_agency.sql @@ -4,7 +4,6 @@ WITH external_operating_expenses_by_type_and_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_operating_expenses_by_type_and_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,35 @@ stg_ntd__operating_expenses_by_type_and_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__operating_expenses_by_type_and_agency +SELECT + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_casualty_and_liability, + sum_fringe_benefits, + sum_fuel_and_lube, + sum_miscellaneous, + sum_operator_paid_absences, + sum_operators_wages, + sum_other_materials_supplies, + sum_other_paid_absences, + sum_other_salaries_wages, + sum_purchased_transportation, + sum_reduced_reporter_expenses, + sum_separate_report_amount, + sum_services, + sum_taxes, + sum_tires, + sum_total, + sum_utilities, + dt, + execution_ts +FROM stg_ntd__operating_expenses_by_type_and_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_agency.sql index e411d7938f..3f65ff9bc3 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_agency.sql @@ -4,7 +4,6 @@ WITH external_service_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_service_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,42 @@ stg_ntd__service_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__service_by_agency +SELECT + _5_digit_ntd_id, + agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_area_sq_miles, + max_primary_uza_code, + max_primary_uza_name, + max_primary_uza_population, + max_reporter_type, + max_service_area_population, + max_service_area_sq_miles, + max_state, + report_year, + sum_actual_vehicles_passenger_car_deadhead_hours, + sum_actual_vehicles_passenger_car_hours, + sum_actual_vehicles_passenger_car_miles, + sum_actual_vehicles_passenger_car_revenue_hours, + sum_actual_vehicles_passenger_car_revenue_miles, + sum_actual_vehicles_passenger_deadhead_miles, + sum_ada_upt, + sum_charter_service_hours, + sum_directional_route_miles, + sum_passenger_miles, + sum_scheduled_vehicles_passenger_car_revenue_miles, + sum_school_bus_hours, + sum_sponsored_service_upt, + sum_train_deadhead_hours, + sum_train_deadhead_miles, + sum_train_hours, + sum_train_miles, + sum_train_revenue_hours, + sum_train_revenue_miles, + sum_trains_in_operation, + sum_unlinked_passenger_trips_upt, + dt, + execution_ts +FROM stg_ntd__service_by_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode.sql index 976251d6b4..9da820b40d 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode.sql @@ -4,7 +4,6 @@ WITH external_service_by_mode AS ( ), get_latest_extract AS( - SELECT * FROM external_service_by_mode -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,53 @@ stg_ntd__service_by_mode AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__service_by_mode +SELECT + _5_digit_ntd_id, + max_agency, + max_agency_voms, + max_city, + max_mode_name, + max_mode_voms, + max_organization_type, + max_primary_uza_area_sq_miles, + max_primary_uza_code, + max_primary_uza_name, + max_primary_uza_population, + max_reporter_type, + max_service_area_population, + max_service_area_sq_miles, + max_state, + max_time_period, + min_time_service_begins, + max_time_service_ends, + mode, + questionable_record, + report_year, + sum_actual_vehicles_passenger_car_deadhead_hours, + sum_actual_vehicles_passenger_car_hours, + sum_actual_vehicles_passenger_car_miles, + sum_actual_vehicles_passenger_car_revenue_hours, + sum_actual_vehicles_passenger_car_revenue_miles, + sum_actual_vehicles_passenger_deadhead_miles, + sum_ada_upt, + sum_charter_service_hours, + sum_days_not_operated_emergencies, + sum_days_not_operated_strikes, + sum_days_of_service_operated, + sum_directional_route_miles, + sum_passenger_miles, + sum_scheduled_vehicles_passenger_car_revenue_miles, + sum_school_bus_hours, + sum_sponsored_service_upt, + sum_train_deadhead_hours, + sum_train_deadhead_miles, + sum_train_hours, + sum_train_miles, + sum_train_revenue_hours, + sum_train_revenue_miles, + sum_trains_in_operation, + sum_unlinked_passenger_trips_upt, + type_of_service, + dt, + execution_ts +FROM stg_ntd__service_by_mode diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode_and_time_period.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode_and_time_period.sql index b640857128..6befa9672d 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode_and_time_period.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__service_by_mode_and_time_period.sql @@ -4,7 +4,6 @@ WITH external_service_by_mode_and_time_period AS ( ), get_latest_extract AS( - SELECT * FROM external_service_by_mode_and_time_period -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,76 @@ stg_ntd__service_by_mode_and_time_period AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__service_by_mode_and_time_period +SELECT + _5_digit_ntd_id, + actual_vehicles_passenger_car_deadhead_hours, + actual_vehicles_passenger_car_hours, + actual_vehicles_passenger_car_miles, + actual_vehicles_passenger_car_revenue_hours, + actual_vehicles_passenger_car_revenue_miles, + actual_vehicles_passenger_deadhead_miles, + ada_upt, + agency, + agency_voms, + aptl_questionable, + average_passenger_trip_length_aptl_, + average_speed, + average_speed_questionable, + brt_non_statutory_mixed_traffic, + city, + charter_service_hours, + days_of_service_operated, + days_not_operated_strikes, + days_not_operated_emergencies, + deadhead_hours_questionable, + deadhead_miles_questionable, + directional_route_miles, + directional_route_miles_questionable, + mixed_traffic_right_of_way, + mode, + mode_name, + mode_voms, + mode_voms_questionable, + organization_type, + passenger_miles, + passenger_miles_questionable, + passengers_per_hour, + passengers_per_hour_questionable, + primary_uza_area_sq_miles, + primary_uza_code, + primary_uza_name, + primary_uza_population, + report_year, + reporter_type, + scheduled_revenue_miles_questionable, + scheduled_vehicles_passenger_car_revenue_miles, + school_bus_hours, + service_area_population, + service_area_sq_miles, + sponsored_service_upt, + state, + time_period, + time_service_begins, + time_service_ends, + train_deadhead_hours, + train_deadhead_miles, + train_hours, + train_hours_questionable, + trains_in_operation, + trains_in_operation_questionable, + train_miles, + train_miles_questionable, + train_revenue_hours, + train_revenue_hours_questionable, + train_revenue_miles, + train_revenue_miles_questionable, + type_of_service, + unlinked_passenger_trips_upt, + unlinked_passenger_trips_questionable, + vehicle_hours_questionable, + vehicle_miles_questionable, + vehicle_revenue_hours_questionable, + vehicle_revenue_miles_questionable, + dt, + execution_ts +FROM stg_ntd__service_by_mode_and_time_period diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_and_facilities_by_agency_and_facility_type.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_and_facilities_by_agency_and_facility_type.sql index cf4f89dc70..7efd54aa78 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_and_facilities_by_agency_and_facility_type.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_and_facilities_by_agency_and_facility_type.sql @@ -4,7 +4,6 @@ WITH external_stations_and_facilities_by_agency_and_facility_type AS ( ), get_latest_extract AS( - SELECT * FROM external_stations_and_facilities_by_agency_and_facility_type -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,44 @@ stg_ntd__stations_and_facilities_by_agency_and_facility_type AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__stations_and_facilities_by_agency_and_facility_type +SELECT + administrative_and_other_non_passenger_facilities, + administrative_office_sales, + agency, + agency_voms, + at_grade_fixed_guideway, + bus_transfer_center, + city, + combined_administrative_and, + elevated_fixed_guideway, + exclusive_grade_separated, + ferryboat_terminal, + general_purpose_maintenance, + heavy_maintenance_overhaul, + maintenance_facilities, + maintenance_facility_service, + ntd_id, + organization_type, + other_administrative, + other_passenger_or_parking, + parking_and_other_passenger_facilities, + parking_structure, + passenger_stations_and_terminals, + primary_uza_population, + report_year, + reporter_type, + revenue_collection_facility, + simple_at_grade_platform, + state, + surface_parking_lot, + total_facilities, + uace_code, + underground_fixed_guideway, + uza_name, + vehicle_blow_down_facility, + vehicle_fueling_facility, + vehicle_testing_facility, + vehicle_washing_facility, + dt, + execution_ts +FROM stg_ntd__stations_and_facilities_by_agency_and_facility_type diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_by_mode_and_age.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_by_mode_and_age.sql index e5f9df8129..a60a5352da 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_by_mode_and_age.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__stations_by_mode_and_age.sql @@ -4,7 +4,6 @@ WITH external_stations_by_mode_and_age AS ( ), get_latest_extract AS( - SELECT * FROM external_stations_by_mode_and_age -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,32 @@ stg_ntd__stations_by_mode_and_age AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__stations_by_mode_and_age +SELECT + _1940s, + _1950s, + _1960s, + _1970s, + _1980s, + _1990s, + _2000s, + _2010s, + _2020s, + agency, + agency_voms, + city, + facility_type, + mode_names, + modes, + ntd_id, + organization_type, + pre1940, + primary_uza_population, + report_year, + reporter_type, + state, + total_facilities, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__stations_by_mode_and_age diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_agency.sql index 982f89deca..bdfcf53284 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_agency.sql @@ -4,7 +4,6 @@ WITH external_track_and_roadway_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_track_and_roadway_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,39 @@ stg_ntd__track_and_roadway_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__track_and_roadway_by_agency +SELECT + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_at_grade_ballast_including, + sum_at_grade_in_street_embedded, + sum_below_grade_bored_or_blasted, + sum_below_grade_cut_and_cover, + sum_below_grade_retained_cut, + sum_below_grade_submerged_tube, + sum_controlled_access_high, + sum_double_crossover, + sum_elevated_concrete, + sum_elevated_retained_fill, + sum_elevated_steel_viaduct_or, + sum_exclusive_fixed_guideway, + sum_exclusive_high_intensity, + sum_grade_crossings, + sum_lapped_turnout, + sum_rail_crossings, + sum_single_crossover, + sum_single_turnout, + sum_slip_switch, + sum_total_miles, + sum_total_track_miles, + dt, + execution_ts +FROM stg_ntd__track_and_roadway_by_agency diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_mode.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_mode.sql index f2d3d3ac7e..256b305237 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_mode.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__track_and_roadway_by_mode.sql @@ -4,7 +4,6 @@ WITH external_track_and_roadway_by_mode AS ( ), get_latest_extract AS( - SELECT * FROM external_track_and_roadway_by_mode -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,63 @@ stg_ntd__track_and_roadway_by_mode AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__track_and_roadway_by_mode +SELECT + agency, + agency_voms, + at_grade_ballast_including, + at_grade_ballast_including_1, + at_grade_in_street_embedded, + at_grade_in_street_embedded_1, + below_grade_bored_or_blasted, + below_grade_bored_or_blasted_1, + below_grade_cut_and_cover, + below_grade_cut_and_cover_1, + below_grade_retained_cut, + below_grade_retained_cut_1, + below_grade_submerged_tube, + below_grade_submerged_tube_1, + city, + controlled_access_high, + controlled_access_high_1, + double_crossover, + double_crossover_q, + elevated_concrete, + elevated_concrete_q, + elevated_retained_fill, + elevated_retained_fill_q, + elevated_steel_viaduct_or, + elevated_steel_viaduct_or_1, + exclusive_fixed_guideway, + exclusive_fixed_guideway_1, + exclusive_high_intensity, + exclusive_high_intensity_1, + grade_crossings, + grade_crossings_q, + lapped_turnout, + lapped_turnout_q, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + primary_uza_population, + rail_crossings, + rail_crossings_q, + report_year, + reporter_type, + single_crossover, + single_crossover_q, + single_turnout, + single_turnout_q, + slip_switch, + slip_switch_q, + state, + total_miles, + total_track_miles, + total_track_miles_q, + type_of_service, + uace_code, + uza_name, + dt, + execution_ts +FROM stg_ntd__track_and_roadway_by_mode diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_age_distribution.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_age_distribution.sql index ed46c3de9a..7f15312f1d 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_age_distribution.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_age_distribution.sql @@ -4,7 +4,6 @@ WITH external_vehicles_age_distribution AS ( ), get_latest_extract AS( - SELECT * FROM external_vehicles_age_distribution -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,41 @@ stg_ntd__vehicles_age_distribution AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__vehicles_age_distribution +SELECT + _0, + _1, + _10, + _11, + _12, + _13_15, + _16_20, + _2, + _21_25, + _26_30, + _3, + _31_60, + _4, + _5, + _6, + _60, + _7, + _8, + _9, + agency, + agency_voms, + average_age_of_fleet_in_years, + average_lifetime_miles_per, + city, + ntd_id, + organization_type, + primary_uza_population, + report_year, + reporter_type, + state, + total_vehicles, + uace_code, + uza_name, + vehicle_type, + dt, + execution_ts +FROM stg_ntd__vehicles_age_distribution diff --git a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_type_count_by_agency.sql b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_type_count_by_agency.sql index 928335887f..6e43c16c3b 100644 --- a/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_type_count_by_agency.sql +++ b/warehouse/models/staging/ntd_annual_reporting/stg_ntd__vehicles_type_count_by_agency.sql @@ -4,7 +4,6 @@ WITH external_vehicles_type_count_by_agency AS ( ), get_latest_extract AS( - SELECT * FROM external_vehicles_type_count_by_agency -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,103 @@ stg_ntd__vehicles_type_count_by_agency AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__vehicles_type_count_by_agency +SELECT + aerial_tram, + aerial_tram_rptulb, + aerial_tram_ulb, + agency, + agency_voms, + articulated_bus, + articulated_bus_ulb, + articulated_busrptulb, + automated_guideway_vehicle, + automated_guideway_vehicle_1, + automated_guideway_vehicle_2, + automobile, + automobile_ulb, + automobilerptulb, + automobiles, + automobiles_ulb, + bus, + bus_ulb, + busrptulb, + cable_car, + cable_car_rptulb, + cable_car_ulb, + city, + commuter_rail_passenger_coach, + commuter_rail_passenger_coach_1, + commuter_rail_passenger_coach_2, + commuter_rail_self_propelled, + commuter_rail_self_propelled_1, + commuter_rail_self_propelled_2, + cutaway, + cutaway_ulb, + cutawayrptulb, + double_decker_bus, + double_decker_bus_ulb, + double_decker_busrptulb, + ferryboat, + ferryboat_rptulb, + ferryboat_ulb, + heavy_rail_passenger_car, + heavy_rail_passenger_car_1, + heavy_rail_passenger_car_2, + inclined_plane, + inclined_plane_rptulb, + inclined_plane_ulb, + light_rail_vehicle, + light_rail_vehicle_rptulb, + light_rail_vehicle_ulb, + locomotive, + locomotive_rptulb, + locomotive_ulb, + minivan, + minivan_ulb, + minivanrptulb, + monorail, + monorail_ulb, + ntd_id, + organization_type, + other, + other_rptulb, + other_ulb, + over_the_road_bus, + over_the_road_bus_ulb, + over_the_road_busrptulb, + primary_uza_population, + report_year, + reporter_type, + school_bus, + school_bus_ulb, + schoolbusrptulb, + sport_utility_vehicle, + sport_utility_vehicle_rptulb, + sport_utility_vehicle_ulb, + state, + steel_wheel_vehicles, + steel_wheel_vehicles_ulb, + streetcar, + streetcar_rptulb, + streetcar_ulb, + total_revenue_vehicles, + total_revenue_vehicles_ulb, + total_rptulb, + total_service_vehicles, + total_service_vehicles_ulb, + trolleybus, + trolleybus_ulb, + trolleybusrptulb, + trucks_and_other_rubber_tire, + trucks_and_other_rubber_tire_1, + uace_code, + uza_name, + van, + van_ulb, + vanrptulb, + vintage_historic_trolley, + vintage_historic_trolley_1, + vintage_historic_trolley_2, + dt, + execution_ts +FROM stg_ntd__vehicles_type_count_by_agency From 456f08bb9fe19746d2d95dfe8287979d63ea6e7a Mon Sep 17 00:00:00 2001 From: Charles Costanzo Date: Mon, 16 Dec 2024 19:18:34 -0500 Subject: [PATCH 2/6] add explicit column names for mart ntd annual tables --- .../dim_2023_agency_information.sql | 48 ++++++++- .../fct_2023_contractual_relationships.sql | 32 +++++- .../ntd_annual_reporting/fct_breakdowns.sql | 34 +++++- .../fct_breakdowns_by_agency.sql | 29 ++++- .../fct_capital_expenses_by_capital_use.sql | 43 +++++++- .../fct_capital_expenses_by_mode.sql | 39 ++++++- ..._capital_expenses_for_existing_service.sql | 28 ++++- ...ital_expenses_for_expansion_of_service.sql | 28 ++++- .../fct_employees_by_agency.sql | 31 +++++- .../fct_employees_by_mode.sql | 24 ++++- ...ct_employees_by_mode_and_employee_type.sql | 44 +++++++- .../fct_fuel_and_energy.sql | 70 +++++++++++- .../fct_fuel_and_energy_by_agency.sql | 35 +++++- .../fct_funding_sources_by_expense_type.sql | 29 ++++- ...fct_funding_sources_directly_generated.sql | 30 +++++- .../fct_funding_sources_federal.sql | 23 +++- .../fct_funding_sources_local.sql | 26 ++++- .../fct_funding_sources_state.sql | 21 +++- ...funding_sources_taxes_levied_by_agency.sql | 24 ++++- .../fct_maintenance_facilities.sql | 44 +++++++- .../fct_maintenance_facilities_by_agency.sql | 28 ++++- .../mart/ntd_annual_reporting/fct_metrics.sql | 44 +++++++- .../fct_operating_expenses_by_function.sql | 34 +++++- ...rating_expenses_by_function_and_agency.sql | 23 +++- .../fct_operating_expenses_by_type.sql | 54 +++++++++- ..._operating_expenses_by_type_and_agency.sql | 33 +++++- .../fct_service_by_agency.sql | 40 ++++++- .../fct_service_by_mode.sql | 51 ++++++++- .../fct_service_by_mode_and_time_period.sql | 74 ++++++++++++- ...facilities_by_agency_and_facility_type.sql | 42 +++++++- .../fct_stations_by_mode_and_age.sql | 30 +++++- .../fct_track_and_roadway_by_agency.sql | 37 ++++++- .../fct_track_and_roadway_by_mode.sql | 61 ++++++++++- .../fct_vehicles_age_distribution.sql | 39 ++++++- .../fct_vehicles_type_count_by_agency.sql | 101 +++++++++++++++++- 35 files changed, 1338 insertions(+), 35 deletions(-) diff --git a/warehouse/models/mart/ntd_annual_reporting/dim_2023_agency_information.sql b/warehouse/models/mart/ntd_annual_reporting/dim_2023_agency_information.sql index d025c265c3..d1ef108f79 100644 --- a/warehouse/models/mart/ntd_annual_reporting/dim_2023_agency_information.sql +++ b/warehouse/models/mart/ntd_annual_reporting/dim_2023_agency_information.sql @@ -8,4 +8,50 @@ dim_2023_agency_information AS ( FROM staging_agency_information ) -SELECT * FROM dim_2023_agency_information +SELECT + number_of_state_counties, + tam_tier, + personal_vehicles, + uza_name, + tribal_area_name, + service_area_sq_miles, + voms_do, + url, + region, + state_admin_funds_expended, + zip_code_ext, + zip_code, + ueid, + address_line_2, + number_of_counties_with_service, + reporter_acronym, + original_due_date, + sq_miles, + address_line_1, + p_o__box, + division_department, + fy_end_date, + service_area_pop, + state, + subrecipient_type, + primary_uza_uace_code, + reported_by_name, + population, + reporting_module, + volunteer_drivers, + doing_business_as, + reporter_type, + legacy_ntd_id, + total_voms, + fta_recipient_id, + city, + voms_pt, + organization_type, + agency_name, + ntd_id, + reported_by_ntd_id, + density, + state_parent_ntd_id, + dt, + execution_ts +FROM dim_2023_agency_information diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_2023_contractual_relationships.sql b/warehouse/models/mart/ntd_annual_reporting/fct_2023_contractual_relationships.sql index fb1500810e..60dfd453bd 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_2023_contractual_relationships.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_2023_contractual_relationships.sql @@ -8,4 +8,34 @@ fct_2023_contractual_relationships AS ( FROM staging_contractual_relationships ) -SELECT * FROM fct_2023_contractual_relationships +SELECT + other_reconciling_item_expenses_incurred_by_the_buyer, + total_modal_expenses, + contract_capital_leasing_expenses, + direct_payment_agency_subsidy, + months_seller_operated_in_fy, + primary_feature, + voms_under_contract, + service_captured, + fares_retained_by, + other_party, + other_public_assets_provided, + buyer_supplies_vehicles_to_seller, + contractee_ntd_id, + pt_fare_revenues_passenger_fees, + agency_name, + tos, + type_of_contract, + reporter_contractual_position, + other_operating_expenses_incurred_by_the_buyer, + passenger_out_of_pocket_expenses, + buyer_provides_maintenance_facility_to_seller, + contractee_operator_name, + mode, + reporting_module, + reporter_type, + other_public_assets_provided_desc, + ntd_id, + dt, + execution_ts +FROM fct_2023_contractual_relationships diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns.sql b/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns.sql index 7b4d5e8449..cedb7985f8 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns.sql @@ -8,4 +8,36 @@ fct_breakdowns AS ( FROM staging_breakdowns ) -SELECT * FROM fct_breakdowns +SELECT + agency, + agency_voms, + city, + major_mechanical_failures, + major_mechanical_failures_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + other_mechanical_failures, + other_mechanical_failures_1, + primary_uza_population, + report_year, + reporter_type, + state, + total_mechanical_failures, + total_mechanical_failures_1, + train_miles, + train_miles_questionable, + train_revenue_miles, + train_revenue_miles_1, + type_of_service, + uace_code, + uza_name, + vehicle_passenger_car_miles, + vehicle_passenger_car_miles_1, + vehicle_passenger_car_miles_2, + vehicle_passenger_car_revenue, + dt, + execution_ts +FROM fct_breakdowns diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns_by_agency.sql index b5839f67b8..e415fb9bfc 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_breakdowns_by_agency.sql @@ -8,4 +8,31 @@ fct_breakdowns_by_agency AS ( FROM staging_breakdowns_by_agency ) -SELECT * FROM fct_breakdowns_by_agency +SELECT + count_major_mechanical_failures_questionable, + count_other_mechanical_failures_questionable, + count_total_mechanical_failures_questionable, + count_train_miles_questionable, + count_train_revenue_miles_questionable, + count_vehicle_passenger_car_miles_questionable, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_major_mechanical_failures, + sum_other_mechanical_failures, + sum_total_mechanical_failures, + sum_train_miles, + sum_train_revenue_miles, + sum_vehicle_passenger_car_miles, + sum_vehicle_passenger_car_revenue, + dt, + execution_ts +FROM fct_breakdowns_by_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_capital_use.sql b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_capital_use.sql index b97ee4b31a..d617bfdffb 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_capital_use.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_capital_use.sql @@ -8,4 +8,45 @@ fct_capital_expenses_by_capital_use AS ( FROM staging_capital_expenses_by_capital_use ) -SELECT * FROM fct_capital_expenses_by_capital_use +SELECT + administrative_buildings, + administrative_buildings_1, + agency, + agency_voms, + city, + communication_information, + communication_information_1, + fare_collection_equipment, + fare_collection_equipment_1, + form_type, + guideway, + guideway_questionable, + maintenance_buildings, + maintenance_buildings_1, + mode_name, + mode_voms, + modecd, + ntd_id, + organization_type, + other, + other_questionable, + other_vehicles, + other_vehicles_questionable, + passenger_vehicles, + passenger_vehicles_1, + primary_uza_population, + reduced_reporter, + reduced_reporter_questionable, + report_year, + reporter_type, + state, + stations, + stations_questionable, + total, + total_questionable, + typeofservicecd, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_capital_expenses_by_capital_use diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_mode.sql b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_mode.sql index d8e05d4b49..bd8b8b79cc 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_mode.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_by_mode.sql @@ -8,4 +8,41 @@ fct_capital_expenses_by_mode AS ( FROM staging_capital_expenses_by_mode ) -SELECT * FROM fct_capital_expenses_by_mode +SELECT + count_administrative_buildings_q, + count_communication_information_q, + count_fare_collection_equipment_q, + count_maintenance_buildings_q, + count_other_q, + count_other_vehicles_q, + count_passenger_vehicles_q, + count_reduced_reporter_q, + count_stations_q, + max_agency, + max_agency_voms, + max_city, + max_mode_name, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + modecd, + ntd_id, + report_year, + sum_administrative_buildings, + sum_communication_information, + sum_fare_collection_equipment, + sum_guideway, + sum_maintenance_buildings, + sum_other, + sum_other_vehicles, + sum_passenger_vehicles, + sum_reduced_reporter, + sum_stations, + sum_total, + typeofservicecd, + dt, + execution_ts +FROM fct_capital_expenses_by_mode diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_existing_service.sql b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_existing_service.sql index 7741c2b9af..d228cc40f2 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_existing_service.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_existing_service.sql @@ -8,4 +8,30 @@ fct_capital_expenses_for_existing_service AS ( FROM staging_capital_expenses_for_existing_service ) -SELECT * FROM fct_capital_expenses_for_existing_service +SELECT + form_type, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_administrative_buildings, + sum_communication_information, + sum_fare_collection_equipment, + sum_guideway, + sum_maintenance_buildings, + sum_other, + sum_other_vehicles, + sum_passenger_vehicles, + sum_reduced_reporter, + sum_stations, + sum_total, + dt, + execution_ts +FROM fct_capital_expenses_for_existing_service diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_expansion_of_service.sql b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_expansion_of_service.sql index af1c07bcd7..c6f794117c 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_expansion_of_service.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_capital_expenses_for_expansion_of_service.sql @@ -8,4 +8,30 @@ fct_capital_expenses_for_expansion_of_service AS ( FROM staging_capital_expenses_for_expansion_of_service ) -SELECT * FROM fct_capital_expenses_for_expansion_of_service +SELECT + form_type, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_administrative_buildings, + sum_communication_information, + sum_fare_collection_equipment, + sum_guideway, + sum_maintenance_buildings, + sum_other, + sum_other_vehicles, + sum_passenger_vehicles, + sum_reduced_reporter, + sum_stations, + sum_total, + dt, + execution_ts +FROM fct_capital_expenses_for_expansion_of_service diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_agency.sql index d578cc025b..4b8bf2e41d 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_agency.sql @@ -8,4 +8,33 @@ fct_employees_by_agency AS ( FROM staging_employees_by_agency ) -SELECT * FROM fct_employees_by_agency +SELECT + agency, + avgwagerate, + count_capital_labor_count_q, + count_capital_labor_hours_q, + count_facility_maintenance_count_q, + count_facility_maintenance_hours_q, + count_general_administration_count_q, + count_general_administration_hours_q, + count_total_employee_count_q, + count_total_employee_hours_q, + count_vehicle_maintenance_count_q, + count_vehicle_maintenance_hours_q, + count_vehicle_operations_count_q, + count_vehicle_operations_hours_q, + max_agency_voms_1, + max_city_1, + max_mode_voms, + max_ntd_id, + max_primary_uza_population_1, + max_state_1, + max_uza_name_1, + report_year, + sum_total_hours, + total_employees, + total_operating_hours, + total_salaries, + dt, + execution_ts +FROM fct_employees_by_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode.sql b/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode.sql index 8ad6d539d3..c4961fa3be 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode.sql @@ -8,4 +8,26 @@ fct_employees_by_mode AS ( FROM staging_employees_by_mode ) -SELECT * FROM fct_employees_by_mode +SELECT + count_capital_labor_count_q, + count_capital_labor_hours_q, + count_facility_maintenance_count_q, + count_facility_maintenance_hours_q, + count_general_administration_count_q, + count_general_administration_hours_q, + count_total_employee_count_q, + count_total_employee_hours_q, + count_vehicle_maintenance_count_q, + count_vehicle_maintenance_hours_q, + count_vehicle_operations_count_q, + count_vehicle_operations_hours_q, + max_mode_name, + mode, + ntd_id, + report_year, + sum_total_employee_count, + sum_total_hours, + type_of_service, + dt, + execution_ts +FROM fct_employees_by_mode diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode_and_employee_type.sql b/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode_and_employee_type.sql index 205cf5831e..2c846add84 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode_and_employee_type.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_employees_by_mode_and_employee_type.sql @@ -8,4 +8,46 @@ fct_employees_by_mode_and_employee_type AS ( FROM staging_employees_by_mode_and_employee_type ) -SELECT * FROM fct_employees_by_mode_and_employee_type +SELECT + agency, + agency_voms, + capital_labor_count, + capital_labor_count_q, + capital_labor_hours, + capital_labor_hours_q, + city, + facility_maintenance_count, + facility_maintenance_count_q, + facility_maintenance_hours, + facility_maintenance_hours_q, + full_or_part_time, + general_administration_count, + general_administration_count_q, + general_administration_hours, + general_administration_hours_q, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + primary_uza_population, + report_year, + state, + total_employee_count, + total_employee_count_q, + total_hours, + total_hours_q, + type_of_service, + uace_code, + uza_name, + vehicle_maintenance_count, + vehicle_maintenance_count_q, + vehicle_maintenance_hours, + vehicle_maintenance_hours_q, + vehicle_operations_count, + vehicle_operations_count_q, + vehicle_operations_hours, + vehicle_operations_hours_q, + dt, + execution_ts +FROM fct_employees_by_mode_and_employee_type diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy.sql b/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy.sql index f0bac78f4f..13202f9cb6 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy.sql @@ -8,4 +8,72 @@ fct_fuel_and_energy AS ( FROM staging_fuel_and_energy ) -SELECT * FROM fct_fuel_and_energy +SELECT + agency, + agency_voms, + bio_diesel_gal, + bio_diesel_gal_questionable, + city, + compressed_natural_gas, + compressed_natural_gas_mpg, + compressed_natural_gas_mpg_1, + compressed_natural_gas_1, + compressed_natural_gas_gal, + compressed_natural_gas_gal_1, + diesel, + diesel_questionable, + diesel_gal, + diesel_gal_questionable, + diesel_mpg, + diesel_mpg_questionable, + electric_battery, + electric_battery_questionable, + electric_battery_kwh, + electric_battery_kwh_1, + electric_battery_mi_kwh, + electric_battery_mi_kwh_1, + electric_propulsion, + electric_propulsion_1, + electric_propulsion_kwh, + electric_propulsion_kwh_1, + electric_propulsion_mi_kwh, + electric_propulsion_mi_kwh_1, + gasoline, + gasoline_mpg, + gasoline_mpg_questionable, + gasoline_questionable, + gasoline_gal, + gasoline_gal_questionable, + hydrogen, + hydrogen_mpkg_, + hydrogen_mpkg_questionable, + hydrogen_questionable, + hydrogen_kg_, + hydrogen_kg_questionable, + liquefied_petroleum_gas, + liquefied_petroleum_gas_mpg, + liquefied_petroleum_gas_mpg_1, + liquefied_petroleum_gas_1, + liquefied_petroleum_gas_gal, + liquefied_petroleum_gas_gal_1, + mode_name, + mode_voms, + modecd, + ntd_id, + organization_type, + other_fuel, + other_fuel_mpg, + other_fuel_mpg_questionable, + other_fuel_questionable, + other_fuel_gal_gal_equivalent, + other_fuel_gal_gal_equivalent_1, + primary_uza_population, + report_year, + reporter_type, + state, + typeofservicecd, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_fuel_and_energy diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy_by_agency.sql index 8ff904f352..384f3e8881 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_fuel_and_energy_by_agency.sql @@ -8,4 +8,37 @@ fct_fuel_and_energy_by_agency AS ( FROM staging_fuel_and_energy_by_agency ) -SELECT * FROM fct_fuel_and_energy_by_agency +SELECT + diesel_gal_questionable, + diesel_mpg_questionable, + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_bio_diesel_gal, + sum_compressed_natural_gas, + sum_compressed_natural_gas_gal, + sum_diesel, + sum_diesel_gal, + sum_electric_battery, + sum_electric_battery_kwh, + sum_electric_propulsion, + sum_electric_propulsion_kwh, + sum_gasoline, + sum_gasoline_gal, + sum_hydrogen, + sum_hydrogen_kg_, + sum_liquefied_petroleum_gas, + sum_liquefied_petroleum_gas_gal, + sum_other_fuel, + sum_other_fuel_gal_gal_equivalent, + dt, + execution_ts +FROM fct_fuel_and_energy_by_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_by_expense_type.sql b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_by_expense_type.sql index 5f19d6f7a3..396840c267 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_by_expense_type.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_by_expense_type.sql @@ -8,4 +8,31 @@ fct_funding_sources_by_expense_type AS ( FROM staging_funding_sources_by_expense_type ) -SELECT * FROM fct_funding_sources_by_expense_type +SELECT + agency, + agency_voms, + city, + fares_and_other_directly, + fares_and_other_directly_1, + federal, + federal_questionable, + fund_expenditure_type, + local, + local_questionable, + ntd_id, + organization_type, + primary_uza_population, + report_year, + reporter_type, + state, + state_1, + state_questionable, + taxes_fees_levied_by_transit, + taxes_fees_levied_by_transit_1, + total, + total_questionable, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_funding_sources_by_expense_type diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_directly_generated.sql b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_directly_generated.sql index d997cc097d..1c7bd121fe 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_directly_generated.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_directly_generated.sql @@ -8,4 +8,32 @@ fct_funding_sources_directly_generated AS ( FROM staging_funding_sources_directly_generated ) -SELECT * FROM fct_funding_sources_directly_generated +SELECT + advertising, + advertising_questionable, + agency, + agency_voms, + city, + concessions, + concessions_questionable, + fares, + fares_questionable, + ntd_id, + organization_type, + other, + other_questionable, + park_and_ride, + park_and_ride_questionable, + primary_uza_population, + purchased_transportation, + purchased_transportation_1, + report_year, + reporter_type, + state, + total, + total_questionable, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_funding_sources_directly_generated diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_federal.sql b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_federal.sql index a4b550d6cf..fcdbab89e3 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_federal.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_federal.sql @@ -8,4 +8,25 @@ fct_funding_sources_federal AS ( FROM staging_funding_sources_federal ) -SELECT * FROM fct_funding_sources_federal +SELECT + agency, + agency_voms, + city, + fta_capital_program_5309, + fta_rural_progam_5311, + fta_urbanized_area_formula, + ntd_id, + organization_type, + other_dot_funds, + other_federal_funds, + other_fta_funds, + primary_uza_population, + report_year, + reporter_type, + state, + total_federal_funds, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_funding_sources_federal diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_local.sql b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_local.sql index 8309405a41..10f9e3e062 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_local.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_local.sql @@ -8,4 +8,28 @@ fct_funding_sources_local AS ( FROM staging_funding_sources_local ) -SELECT * FROM fct_funding_sources_local +SELECT + agency, + agency_voms, + city, + fuel_tax, + general_fund, + income_tax, + ntd_id, + organization_type, + other_funds, + other_taxes, + primary_uza_population, + property_tax, + reduced_reporter_funds, + report_year, + reporter_type, + sales_tax, + state, + tolls, + total, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_funding_sources_local diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_state.sql b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_state.sql index e97cc3a363..6ee2cad9b1 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_state.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_state.sql @@ -8,4 +8,23 @@ fct_funding_sources_state AS ( FROM staging_funding_sources_state ) -SELECT * FROM fct_funding_sources_state +SELECT + agency, + agency_voms, + city, + general_funds, + ntd_id, + organization_type, + primary_uza_population, + reduced_reporter_funds, + report_year, + reporter_type, + state, + total, + total_questionable, + transportation_funds, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_funding_sources_state diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_taxes_levied_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_taxes_levied_by_agency.sql index 72e0a8b9c4..6d264e897a 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_taxes_levied_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_funding_sources_taxes_levied_by_agency.sql @@ -8,4 +8,26 @@ fct_funding_sources_taxes_levied_by_agency AS ( FROM staging_funding_sources_taxes_levied_by_agency ) -SELECT * FROM fct_funding_sources_taxes_levied_by_agency +SELECT + agency, + agency_voms, + city, + fuel_tax, + income_tax, + ntd_id, + organization_type, + other_funds, + other_tax, + primary_uza_population, + property_tax, + report_year, + reporter_type, + sales_tax, + state, + tolls, + total, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_funding_sources_taxes_levied_by_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities.sql b/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities.sql index 530ded5c41..2491817c25 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities.sql @@ -8,4 +8,46 @@ fct_maintenance_facilities AS ( FROM staging_maintenance_facilities ) -SELECT * FROM fct_maintenance_facilities +SELECT + _200_to_300_vehicles, + _200_to_300_vehicles_1, + agency, + agency_voms, + city, + heavy_maintenance_facilities, + heavy_maintenance_facilities_1, + leased_by_pt_provider, + leased_by_pt_provider_1, + leased_by_public_agency, + leased_by_public_agency_1, + leased_from_a_private_entity, + leased_from_a_private_entity_1, + leased_from_a_public_entity, + leased_from_a_public_entity_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + over_300_vehicles, + over_300_vehicles_questionable, + owned, + owned_questionable, + owned_by_pt_provider, + owned_by_pt_provider_1, + owned_by_public_agency, + owned_by_public_agency_1, + primary_uza_population, + report_year, + reporter_type, + state, + total_facilities, + total_maintenance_facilities, + type_of_service, + uace_code, + under_200_vehicles, + under_200_vehicles_1, + uza_name, + dt, + execution_ts +FROM fct_maintenance_facilities diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities_by_agency.sql index f45ba8f08f..efd3323148 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_maintenance_facilities_by_agency.sql @@ -8,4 +8,30 @@ fct_maintenance_facilities_by_agency AS ( FROM staging_maintenance_facilities_by_agency ) -SELECT * FROM fct_maintenance_facilities_by_agency +SELECT + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_200_to_300_vehicles, + sum_heavy_maintenance_facilities, + sum_leased_by_pt_provider, + sum_leased_by_public_agency, + sum_leased_from_a_private_entity, + sum_leased_from_a_public_entity, + sum_over_300_vehicles, + sum_owned, + sum_owned_by_pt_provider, + sum_owned_by_public_agency, + sum_total_facilities, + sum_under_200_vehicles, + dt, + execution_ts +FROM fct_maintenance_facilities_by_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_metrics.sql b/warehouse/models/mart/ntd_annual_reporting/fct_metrics.sql index c8d517af7e..b3cf3dc2e7 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_metrics.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_metrics.sql @@ -8,4 +8,46 @@ fct_metrics AS ( FROM staging_metrics ) -SELECT * FROM fct_metrics +SELECT + agency, + agency_voms, + city, + cost_per_hour, + cost_per_hour_questionable, + cost_per_passenger, + cost_per_passenger_1, + cost_per_passenger_mile, + cost_per_passenger_mile_1, + fare_revenues_earned, + fare_revenues_earned_1, + fare_revenues_per_total, + fare_revenues_per_total_1, + fare_revenues_per_unlinked, + fare_revenues_per_unlinked_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + passenger_miles, + passenger_miles_questionable, + passengers_per_hour, + passengers_per_hour_1, + primary_uza_population, + report_year, + reporter_type, + state, + total_operating_expenses, + total_operating_expenses_1, + type_of_service, + unlinked_passenger_trips, + unlinked_passenger_trips_1, + vehicle_revenue_hours, + vehicle_revenue_hours_1, + vehicle_revenue_miles, + vehicle_revenue_miles_1, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_metrics diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function.sql b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function.sql index a87a0154d8..99810cac9c 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function.sql @@ -8,4 +8,36 @@ fct_operating_expenses_by_function AS ( FROM staging_operating_expenses_by_function ) -SELECT * FROM fct_operating_expenses_by_function +SELECT + agency, + agency_voms, + city, + facility_maintenance, + facility_maintenance_1, + general_administration, + general_administration_1, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + primary_uza_population, + reduced_reporter_expenses, + reduced_reporter_expenses_1, + report_year, + reporter_type, + separate_report_amount, + separate_report_amount_1, + state, + total, + total_questionable, + type_of_service, + vehicle_maintenance, + vehicle_maintenance_1, + vehicle_operations, + vehicle_operations_1, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_operating_expenses_by_function diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function_and_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function_and_agency.sql index 386eff8329..1c05549b75 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function_and_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_function_and_agency.sql @@ -8,4 +8,25 @@ fct_operating_expenses_by_function_and_agency AS ( FROM staging_operating_expenses_by_function_and_agency ) -SELECT * FROM fct_operating_expenses_by_function_and_agency +SELECT + agency, + city, + max_agency_voms, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + state, + sum_facility_maintenance, + sum_general_administration, + sum_reduced_reporter_expenses, + sum_separate_report_amount, + sum_vehicle_maintenance, + sum_vehicle_operations, + total, + dt, + execution_ts +FROM fct_operating_expenses_by_function_and_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type.sql b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type.sql index 98187e2608..4e916c8817 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type.sql @@ -8,4 +8,56 @@ fct_operating_expenses_by_type AS ( FROM staging_operating_expenses_by_type ) -SELECT * FROM fct_operating_expenses_by_type +SELECT + agency, + agency_voms, + casualty_and_liability, + casualty_and_liability_1, + city, + fringe_benefits, + fringe_benefits_questionable, + fuel_and_lube, + fuel_and_lube_questionable, + miscellaneous, + miscellaneous_questionable, + mode, + mode_name, + mode_voms, + ntd_id, + operator_paid_absences, + operator_paid_absences_1, + operators_wages, + operators_wages_questionable, + organization_type, + other_materials_supplies, + other_materials_supplies_1, + other_paid_absences, + other_paid_absences_1, + other_salaries_wages, + other_salaries_wages_1, + primary_uza_population, + purchased_transportation, + purchased_transportation_1, + reduced_reporter_expenses, + reduced_reporter_expenses_1, + report_year, + reporter_type, + separate_report_amount, + separate_report_amount_1, + services, + services_questionable, + state, + taxes, + taxes_questionable, + tires, + tires_questionable, + total, + total_questionable, + type_of_service, + uace_code, + utilities, + utilities_questionable, + uza_name, + dt, + execution_ts +FROM fct_operating_expenses_by_type diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type_and_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type_and_agency.sql index 8c39a3c286..712f32a9b6 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type_and_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_operating_expenses_by_type_and_agency.sql @@ -8,4 +8,35 @@ fct_operating_expenses_by_type_and_agency AS ( FROM staging_operating_expenses_by_type_and_agency ) -SELECT * FROM fct_operating_expenses_by_type_and_agency +SELECT + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_casualty_and_liability, + sum_fringe_benefits, + sum_fuel_and_lube, + sum_miscellaneous, + sum_operator_paid_absences, + sum_operators_wages, + sum_other_materials_supplies, + sum_other_paid_absences, + sum_other_salaries_wages, + sum_purchased_transportation, + sum_reduced_reporter_expenses, + sum_separate_report_amount, + sum_services, + sum_taxes, + sum_tires, + sum_total, + sum_utilities, + dt, + execution_ts +FROM fct_operating_expenses_by_type_and_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_service_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_service_by_agency.sql index 49df2a8c74..6b8b002999 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_service_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_service_by_agency.sql @@ -8,4 +8,42 @@ fct_service_by_agency AS ( FROM staging_service_by_agency ) -SELECT * FROM fct_service_by_agency +SELECT + _5_digit_ntd_id, + agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_area_sq_miles, + max_primary_uza_code, + max_primary_uza_name, + max_primary_uza_population, + max_reporter_type, + max_service_area_population, + max_service_area_sq_miles, + max_state, + report_year, + sum_actual_vehicles_passenger_car_deadhead_hours, + sum_actual_vehicles_passenger_car_hours, + sum_actual_vehicles_passenger_car_miles, + sum_actual_vehicles_passenger_car_revenue_hours, + sum_actual_vehicles_passenger_car_revenue_miles, + sum_actual_vehicles_passenger_deadhead_miles, + sum_ada_upt, + sum_charter_service_hours, + sum_directional_route_miles, + sum_passenger_miles, + sum_scheduled_vehicles_passenger_car_revenue_miles, + sum_school_bus_hours, + sum_sponsored_service_upt, + sum_train_deadhead_hours, + sum_train_deadhead_miles, + sum_train_hours, + sum_train_miles, + sum_train_revenue_hours, + sum_train_revenue_miles, + sum_trains_in_operation, + sum_unlinked_passenger_trips_upt, + dt, + execution_ts +FROM fct_service_by_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode.sql b/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode.sql index 15c7e7879a..75c9901449 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode.sql @@ -8,4 +8,53 @@ fct_service_by_mode AS ( FROM staging_service_by_mode ) -SELECT * FROM fct_service_by_mode +SELECT + _5_digit_ntd_id, + max_agency, + max_agency_voms, + max_city, + max_mode_name, + max_mode_voms, + max_organization_type, + max_primary_uza_area_sq_miles, + max_primary_uza_code, + max_primary_uza_name, + max_primary_uza_population, + max_reporter_type, + max_service_area_population, + max_service_area_sq_miles, + max_state, + max_time_period, + min_time_service_begins, + max_time_service_ends, + mode, + questionable_record, + report_year, + sum_actual_vehicles_passenger_car_deadhead_hours, + sum_actual_vehicles_passenger_car_hours, + sum_actual_vehicles_passenger_car_miles, + sum_actual_vehicles_passenger_car_revenue_hours, + sum_actual_vehicles_passenger_car_revenue_miles, + sum_actual_vehicles_passenger_deadhead_miles, + sum_ada_upt, + sum_charter_service_hours, + sum_days_not_operated_emergencies, + sum_days_not_operated_strikes, + sum_days_of_service_operated, + sum_directional_route_miles, + sum_passenger_miles, + sum_scheduled_vehicles_passenger_car_revenue_miles, + sum_school_bus_hours, + sum_sponsored_service_upt, + sum_train_deadhead_hours, + sum_train_deadhead_miles, + sum_train_hours, + sum_train_miles, + sum_train_revenue_hours, + sum_train_revenue_miles, + sum_trains_in_operation, + sum_unlinked_passenger_trips_upt, + type_of_service, + dt, + execution_ts +FROM fct_service_by_mode diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode_and_time_period.sql b/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode_and_time_period.sql index 027708510a..9b5ca4776d 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode_and_time_period.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_service_by_mode_and_time_period.sql @@ -8,4 +8,76 @@ fct_service_by_mode_and_time_period AS ( FROM staging_service_by_mode_and_time_period ) -SELECT * FROM fct_service_by_mode_and_time_period +SELECT + _5_digit_ntd_id, + actual_vehicles_passenger_car_deadhead_hours, + actual_vehicles_passenger_car_hours, + actual_vehicles_passenger_car_miles, + actual_vehicles_passenger_car_revenue_hours, + actual_vehicles_passenger_car_revenue_miles, + actual_vehicles_passenger_deadhead_miles, + ada_upt, + agency, + agency_voms, + aptl_questionable, + average_passenger_trip_length_aptl_, + average_speed, + average_speed_questionable, + brt_non_statutory_mixed_traffic, + city, + charter_service_hours, + days_of_service_operated, + days_not_operated_strikes, + days_not_operated_emergencies, + deadhead_hours_questionable, + deadhead_miles_questionable, + directional_route_miles, + directional_route_miles_questionable, + mixed_traffic_right_of_way, + mode, + mode_name, + mode_voms, + mode_voms_questionable, + organization_type, + passenger_miles, + passenger_miles_questionable, + passengers_per_hour, + passengers_per_hour_questionable, + primary_uza_area_sq_miles, + primary_uza_code, + primary_uza_name, + primary_uza_population, + report_year, + reporter_type, + scheduled_revenue_miles_questionable, + scheduled_vehicles_passenger_car_revenue_miles, + school_bus_hours, + service_area_population, + service_area_sq_miles, + sponsored_service_upt, + state, + time_period, + time_service_begins, + time_service_ends, + train_deadhead_hours, + train_deadhead_miles, + train_hours, + train_hours_questionable, + trains_in_operation, + trains_in_operation_questionable, + train_miles, + train_miles_questionable, + train_revenue_hours, + train_revenue_hours_questionable, + train_revenue_miles, + train_revenue_miles_questionable, + type_of_service, + unlinked_passenger_trips_upt, + unlinked_passenger_trips_questionable, + vehicle_hours_questionable, + vehicle_miles_questionable, + vehicle_revenue_hours_questionable, + vehicle_revenue_miles_questionable, + dt, + execution_ts +FROM fct_service_by_mode_and_time_period diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_stations_and_facilities_by_agency_and_facility_type.sql b/warehouse/models/mart/ntd_annual_reporting/fct_stations_and_facilities_by_agency_and_facility_type.sql index bbceb59206..5221252d3a 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_stations_and_facilities_by_agency_and_facility_type.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_stations_and_facilities_by_agency_and_facility_type.sql @@ -8,4 +8,44 @@ fct_stations_and_facilities_by_agency_and_facility_type AS ( FROM staging_stations_and_facilities_by_agency_and_facility_type ) -SELECT * FROM fct_stations_and_facilities_by_agency_and_facility_type +SELECT + administrative_and_other_non_passenger_facilities, + administrative_office_sales, + agency, + agency_voms, + at_grade_fixed_guideway, + bus_transfer_center, + city, + combined_administrative_and, + elevated_fixed_guideway, + exclusive_grade_separated, + ferryboat_terminal, + general_purpose_maintenance, + heavy_maintenance_overhaul, + maintenance_facilities, + maintenance_facility_service, + ntd_id, + organization_type, + other_administrative, + other_passenger_or_parking, + parking_and_other_passenger_facilities, + parking_structure, + passenger_stations_and_terminals, + primary_uza_population, + report_year, + reporter_type, + revenue_collection_facility, + simple_at_grade_platform, + state, + surface_parking_lot, + total_facilities, + uace_code, + underground_fixed_guideway, + uza_name, + vehicle_blow_down_facility, + vehicle_fueling_facility, + vehicle_testing_facility, + vehicle_washing_facility, + dt, + execution_ts +FROM fct_stations_and_facilities_by_agency_and_facility_type diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_stations_by_mode_and_age.sql b/warehouse/models/mart/ntd_annual_reporting/fct_stations_by_mode_and_age.sql index b376ab5dc5..2fb15eb8f4 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_stations_by_mode_and_age.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_stations_by_mode_and_age.sql @@ -8,4 +8,32 @@ fct_stations_by_mode_and_age AS ( FROM staging_stations_by_mode_and_age ) -SELECT * FROM fct_stations_by_mode_and_age +SELECT + _1940s, + _1950s, + _1960s, + _1970s, + _1980s, + _1990s, + _2000s, + _2010s, + _2020s, + agency, + agency_voms, + city, + facility_type, + mode_names, + modes, + ntd_id, + organization_type, + pre1940, + primary_uza_population, + report_year, + reporter_type, + state, + total_facilities, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_stations_by_mode_and_age diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_agency.sql index d9b11b6bff..bedea1d39f 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_agency.sql @@ -8,4 +8,39 @@ fct_track_and_roadway_by_agency AS ( FROM staging_track_and_roadway_by_agency ) -SELECT * FROM fct_track_and_roadway_by_agency +SELECT + max_agency, + max_agency_voms, + max_city, + max_organization_type, + max_primary_uza_population, + max_reporter_type, + max_state, + max_uace_code, + max_uza_name, + ntd_id, + report_year, + sum_at_grade_ballast_including, + sum_at_grade_in_street_embedded, + sum_below_grade_bored_or_blasted, + sum_below_grade_cut_and_cover, + sum_below_grade_retained_cut, + sum_below_grade_submerged_tube, + sum_controlled_access_high, + sum_double_crossover, + sum_elevated_concrete, + sum_elevated_retained_fill, + sum_elevated_steel_viaduct_or, + sum_exclusive_fixed_guideway, + sum_exclusive_high_intensity, + sum_grade_crossings, + sum_lapped_turnout, + sum_rail_crossings, + sum_single_crossover, + sum_single_turnout, + sum_slip_switch, + sum_total_miles, + sum_total_track_miles, + dt, + execution_ts +FROM fct_track_and_roadway_by_agency diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_mode.sql b/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_mode.sql index 713a48c73a..14e25863d8 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_mode.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_track_and_roadway_by_mode.sql @@ -8,4 +8,63 @@ fct_track_and_roadway_by_mode AS ( FROM staging_track_and_roadway_by_mode ) -SELECT * FROM fct_track_and_roadway_by_mode +SELECT + agency, + agency_voms, + at_grade_ballast_including, + at_grade_ballast_including_1, + at_grade_in_street_embedded, + at_grade_in_street_embedded_1, + below_grade_bored_or_blasted, + below_grade_bored_or_blasted_1, + below_grade_cut_and_cover, + below_grade_cut_and_cover_1, + below_grade_retained_cut, + below_grade_retained_cut_1, + below_grade_submerged_tube, + below_grade_submerged_tube_1, + city, + controlled_access_high, + controlled_access_high_1, + double_crossover, + double_crossover_q, + elevated_concrete, + elevated_concrete_q, + elevated_retained_fill, + elevated_retained_fill_q, + elevated_steel_viaduct_or, + elevated_steel_viaduct_or_1, + exclusive_fixed_guideway, + exclusive_fixed_guideway_1, + exclusive_high_intensity, + exclusive_high_intensity_1, + grade_crossings, + grade_crossings_q, + lapped_turnout, + lapped_turnout_q, + mode, + mode_name, + mode_voms, + ntd_id, + organization_type, + primary_uza_population, + rail_crossings, + rail_crossings_q, + report_year, + reporter_type, + single_crossover, + single_crossover_q, + single_turnout, + single_turnout_q, + slip_switch, + slip_switch_q, + state, + total_miles, + total_track_miles, + total_track_miles_q, + type_of_service, + uace_code, + uza_name, + dt, + execution_ts +FROM fct_track_and_roadway_by_mode diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_age_distribution.sql b/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_age_distribution.sql index 630d959c7a..3699dbf25c 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_age_distribution.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_age_distribution.sql @@ -8,4 +8,41 @@ fct_vehicles_age_distribution AS ( FROM staging_vehicles_age_distribution ) -SELECT * FROM fct_vehicles_age_distribution +SELECT + _0, + _1, + _10, + _11, + _12, + _13_15, + _16_20, + _2, + _21_25, + _26_30, + _3, + _31_60, + _4, + _5, + _6, + _60, + _7, + _8, + _9, + agency, + agency_voms, + average_age_of_fleet_in_years, + average_lifetime_miles_per, + city, + ntd_id, + organization_type, + primary_uza_population, + report_year, + reporter_type, + state, + total_vehicles, + uace_code, + uza_name, + vehicle_type, + dt, + execution_ts +FROM fct_vehicles_age_distribution diff --git a/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_type_count_by_agency.sql b/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_type_count_by_agency.sql index 32928c9c91..63e9632e02 100644 --- a/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_type_count_by_agency.sql +++ b/warehouse/models/mart/ntd_annual_reporting/fct_vehicles_type_count_by_agency.sql @@ -8,4 +8,103 @@ fct_vehicles_type_count_by_agency AS ( FROM staging_vehicles_type_count_by_agency ) -SELECT * FROM fct_vehicles_type_count_by_agency +SELECT + aerial_tram, + aerial_tram_rptulb, + aerial_tram_ulb, + agency, + agency_voms, + articulated_bus, + articulated_bus_ulb, + articulated_busrptulb, + automated_guideway_vehicle, + automated_guideway_vehicle_1, + automated_guideway_vehicle_2, + automobile, + automobile_ulb, + automobilerptulb, + automobiles, + automobiles_ulb, + bus, + bus_ulb, + busrptulb, + cable_car, + cable_car_rptulb, + cable_car_ulb, + city, + commuter_rail_passenger_coach, + commuter_rail_passenger_coach_1, + commuter_rail_passenger_coach_2, + commuter_rail_self_propelled, + commuter_rail_self_propelled_1, + commuter_rail_self_propelled_2, + cutaway, + cutaway_ulb, + cutawayrptulb, + double_decker_bus, + double_decker_bus_ulb, + double_decker_busrptulb, + ferryboat, + ferryboat_rptulb, + ferryboat_ulb, + heavy_rail_passenger_car, + heavy_rail_passenger_car_1, + heavy_rail_passenger_car_2, + inclined_plane, + inclined_plane_rptulb, + inclined_plane_ulb, + light_rail_vehicle, + light_rail_vehicle_rptulb, + light_rail_vehicle_ulb, + locomotive, + locomotive_rptulb, + locomotive_ulb, + minivan, + minivan_ulb, + minivanrptulb, + monorail, + monorail_ulb, + ntd_id, + organization_type, + other, + other_rptulb, + other_ulb, + over_the_road_bus, + over_the_road_bus_ulb, + over_the_road_busrptulb, + primary_uza_population, + report_year, + reporter_type, + school_bus, + school_bus_ulb, + schoolbusrptulb, + sport_utility_vehicle, + sport_utility_vehicle_rptulb, + sport_utility_vehicle_ulb, + state, + steel_wheel_vehicles, + steel_wheel_vehicles_ulb, + streetcar, + streetcar_rptulb, + streetcar_ulb, + total_revenue_vehicles, + total_revenue_vehicles_ulb, + total_rptulb, + total_service_vehicles, + total_service_vehicles_ulb, + trolleybus, + trolleybus_ulb, + trolleybusrptulb, + trucks_and_other_rubber_tire, + trucks_and_other_rubber_tire_1, + uace_code, + uza_name, + van, + van_ulb, + vanrptulb, + vintage_historic_trolley, + vintage_historic_trolley_1, + vintage_historic_trolley_2, + dt, + execution_ts +FROM fct_vehicles_type_count_by_agency From 08831085951b0c9ab9702c2f877a9a5ff233c9a5 Mon Sep 17 00:00:00 2001 From: Charles Costanzo Date: Mon, 16 Dec 2024 19:19:00 -0500 Subject: [PATCH 3/6] add explicit column names for staging ntd safety and security tables --- ...a_regulated_mode_major_security_events.sql | 97 +++++++++++++- .../stg_ntd__major_safety_events.sql | 28 +++- ...y_modal_time_series_safety_and_service.sql | 81 ++++++++++- ...d__nonmajor_safety_and_security_events.sql | 126 +++++++++++++++++- 4 files changed, 320 insertions(+), 12 deletions(-) diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql index f71b543cc9..c29f0d9afe 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql @@ -1,10 +1,9 @@ WITH external_fra_regulated_mode_major_security_events AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'historical__fra_regulated_mode_major_security_events') }} + FROM {{ source('external_ntd__safety_and_security', 'multi_year__fra_regulated_mode_major_security_events') }} ), get_latest_extract AS( - SELECT * FROM external_fra_regulated_mode_major_security_events -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,96 @@ stg_ntd__fra_regulated_mode_major_security_events AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__fra_regulated_mode_major_security_events +SELECT + other_vehicle_action, + manufacturer_description, + evacuation_comment, + manufacturer, + non_rail_transit_vehicle, + fuel_type, + transit_y_n, + evacuation_location, + rail_alignment, + path_condition, + weather, + collision_with, + fire_type, + suicide_serious_injuries, + other_serious_injuries, + other_injuries, + occupant_of_other_vehicle_2, + other_involved_veh, + vehicle_speed, + occupant_of_other_vehicle_1, + pedestrian_walking_along_1, + vehicle_action, + pedestrian_crossing_tracks_1, + pedestrian_not_in_crosswalk_1, + pedestrian_in_crosswalk_2, + pedestrian_in_crosswalk_1, + rail_bus_ferry, + people_waiting_or_leaving, + other_worker_serious_injuries, + transit_employee_injuries, + configuration, + transit_vehicle_rider_serious, + longitude, + occupant_of_other_vehicle, + pedestrian_crossing_tracks, + latitude, + lighting, + people_waiting_or_leaving_2, + other_worker_injuries, + transit_vehicle_rider_injuries, + suicide_fatalities, + transit_vehicle_rider, + pedestrian_in_crosswalk, + action_type, + bicyclist_serious_injuries, + total_fatalities, + people_waiting_or_leaving_1, + pedestrian_crossing_tracks_2, + bicyclist_fatalities, + safety_security, + transit_employee_fatalities, + transit_vehicle_operator, + property_damage_type, + transit_employee_serious, + rail_grade_crossing_control, + intentional_y_n, + total_injuries, + event_type, + event_location, + number_of_vehicles_involved, + suicide_injuries, + pedestrian_walking_along, + person_list, + type_of_service, + mode, + self_evacuation_y_n, + bicyclist_injuries, + property_damage, + pedestrian_not_in_crosswalk_2, + fixed_route_flag, + transit_vehicle_operator_1, + incident_description, + incident_date, + approximate_address, + other_worker_fatalities, + incident_time, + pedestrian_walking_along_2, + towed_y_n, + agency, + right_of_way_condition, + fire_fuel, + number_of_transit_vehicles, + year, + transit_vehicle_operator_2, + incident_number, + other_fatalities, + pedestrian_not_in_crosswalk, + number_of_derailed_cars, + ntd_id, + dt, + execution_ts +FROM stg_ntd__fra_regulated_mode_major_security_events diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql index 00348262b4..f35a845d07 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql @@ -1,10 +1,9 @@ WITH external_major_safety_events AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'historical__major_safety_events') }} + FROM {{ source('external_ntd__safety_and_security', 'multi_year__major_safety_events') }} ), get_latest_extract AS( - SELECT * FROM external_major_safety_events -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,27 @@ stg_ntd__major_safety_events AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__major_safety_events +SELECT + other, + worker, + minor_nonphysical_assaults_on_other_transit_workers, + total_injuries, + non_physical_assaults_on_operators_security_events_only_, + total_incidents, + minor_physical_assaults_on_operators, + minor_physical_assaults_on_other_transit_workers, + location_group, + location, + eventtype, + additional_assault_information, + sftsecfl, + yr, + modecd, + mo, + typeofservicecd, + reportername, + customer, + ntdid, + dt, + execution_ts +FROM stg_ntd__major_safety_events diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql index 9250aadaee..8add493dbb 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql @@ -1,10 +1,9 @@ WITH external_monthly_modal_time_series_safety_and_service AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'historical__monthly_modal_time_series_safety_and_service') }} + FROM {{ source('external_ntd__safety_and_security', 'multi_year__monthly_modal_time_series_safety_and_service') }} ), get_latest_extract AS( - SELECT * FROM external_monthly_modal_time_series_safety_and_service -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,80 @@ stg_ntd__monthly_modal_time_series_safety_and_service AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__monthly_modal_time_series_safety_and_service +SELECT + major_non_physical_assaults_on_operators, + major_non_physical_assaults_on_other_transit_workers, + major_physical_assaults_on_operators, + non_major_non_physical_assaults_on_other_transit_workers, + non_major_physical_assaults_on_other_transit_workers, + non_major_non_physical_assaults_on_operators, + total_injuries, + trespasser_injuries, + other_injuries, + other_vehicle_occupant_1, + pedestrian_walking_along_1, + pedestrian_in_corsswalk, + bicyclist_injuries, + other_worker_injuries, + total_employee_injuries, + other_employee_injuries, + operator_injuries, + total_other_fatalities, + other_vehicle_occupant, + people_waiting_or_leaving_1, + total_fatalities, + trespasser_fatalities, + suicide_injuries, + collisions_with_other, + pedestrian_walking_along, + suicide_fatalities, + pedestrian_in_crosswalk, + bicyclist_fatalities, + other_worker_fatalities, + type_of_service, + mode, + passenger_fatalities, + total_employee_fatalities, + operator_fatalities, + people_waiting_or_leaving, + uace_code, + month, + total_events_not_otherwise, + primary_uza_population, + collisions_with_bus_vehicle, + total_security_events, + total_events, + rail_y_n, + total_fires, + total_derailments, + pedestrian_crossing_tracks, + total_assaults_on_transit_workers, + total_collisions, + agency, + collisions_with_rail_vehicle, + passenger_injuries, + collisions_with_fixed_object, + ridership, + service_area_population, + collisions_with_person, + major_physical_assaults_on_other_transit_workers, + collisions_with_motor_vehicle, + service_area_sq_miles, + other_employee_fatalities, + non_major_physical_assaults_on_operators, + year, + vehicle_revenue_hours, + pedestrian_not_in_crosswalk_1, + vehicle_revenue_miles, + vehicles, + organization_type, + pedestrian_crossing_tracks_1, + primary_uza_sq_miles, + primary_uza_name, + _5_digit_ntd_id, + total_other_injuries, + other_fatalities, + pedestrian_not_in_crosswalk, + dt, + execution_ts +FROM stg_ntd__monthly_modal_time_series_safety_and_service diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql index 31aae3219f..94eeed0159 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql @@ -1,10 +1,9 @@ WITH external_nonmajor_safety_and_security_events AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'historical__nonmajor_safety_and_security_events') }} + FROM {{ source('external_ntd__safety_and_security', 'multi_year__nonmajor_safety_and_security_events') }} ), get_latest_extract AS( - SELECT * FROM external_nonmajor_safety_and_security_events -- we pull the whole table every month in the pipeline, so this gets only the latest extract @@ -16,4 +15,125 @@ stg_ntd__nonmajor_safety_and_security_events AS ( FROM get_latest_extract ) -SELECT * FROM stg_ntd__nonmajor_safety_and_security_events +SELECT + other_fire_fuel_description, + operator_location, + tide, + current_condition, + runaway_train_flag, + track_configuration, + hazmat_type, + fire_fuel, + fire_type, + rail_grade_crossing_control, + incident_number, + manufacturer, + non_rail_transit_vehicle, + derailed_cars_count, + fuel_type, + transit_y_n, + evacuation, + path_condition, + suicide_fatalities, + weather, + collision_with, + other_event_type_description, + total_serious_injuries, + transit_vehicle_operator_2, + property_damage, + trespasser_inuries_subtotal_, + bicyclist_serious_injuries, + suicide_serious_injuries, + transit_vehicle_rider, + other_serious_injuries, + evacuation_location, + other_injuries, + occupant_of_other_vehicle_2, + pedestrian_walking_along_1, + vehicle_action, + pedestrian_crossing_tracks_1, + hazmat_type_description, + pedestrian_not_in_crosswalk_1, + pederstiran_in_crosswalk, + __computed_region_8fe2_rd7y, + bicyclist_injuries, + _5_digit_ntd_id, + transit_employee_serious, + transit_employee_injuries, + trespasser_serious_injuries_subtotal_, + transit_vehicle_rider_serious, + intentional_y_n, + transit_vehicle_rider_injuries, + trespasser_fatalities_subtotal_, + other_fatalities, + longitude, + occupant_of_other_vehicle, + evacuation_comment, + latitude, + pedestrian_crossing_tracks, + rail_alignment, + pedestrian_in_crosswalk, + safety_security, + transit_employee_fatalities, + revenue_vehicle_identifier_list, + manufacturer_description, + transit_vehicle_operator, + evac_to_right_of_way, + event_type, + total_injuries, + life_safety_y_n, + latlon, + lighting, + other_worker_injuries, + people_waiting_or_leaving_2, + location_type, + pedestrian_crossing_tracks_2, + bicyclist_fatalities, + number_of_cars_on_involved_transit_vehicles, + number_of_vehicles_involved, + approximate_address, + __computed_region_m2nu_4dib, + derailment_type, + suicide_injuries, + mode_name, + pedestrian_walking_along, + assault_homicide_transit_worker_flag, + action_type, + people_waiting_or_leaving_1, + property_damage_type, + total_fatalities, + road_configuration, + self_evacuation_y_n, + incident_time, + person_list, + type_of_service, + vehicle_speed, + mode, + other_worker_serious_injuries, + rail_bus_ferry, + transit_vehicle_operator_1, + people_waiting_or_leaving, + pedestrian_not_in_crosswalk_2, + fixed_route_flag, + event_category, + assault_homicide_type_desc, + event_type_group, + other_worker_fatalities, + incident_description, + pederstiran_in_crosswalk_1, + assault_homicide_person_type_desc, + service_stop_control_device, + incident_date, + pedestrian_walking_along_2, + towed_y_n, + agency, + intersection, + occupant_of_other_vehicle_1, + pedestrian_not_in_crosswalk, + right_of_way_condition, + number_of_transit_vehicles, + year, + uace_code, + dt, + execution_ts +FROM stg_ntd__nonmajor_safety_and_security_events From 782953173e68a619ade4a2714b3546aed0f64649 Mon Sep 17 00:00:00 2001 From: Charles Costanzo Date: Mon, 16 Dec 2024 19:19:20 -0500 Subject: [PATCH 4/6] add explicit column names for mart ntd safety and security tables --- ...a_regulated_mode_major_security_events.sql | 94 ++++++++++++- .../fct_major_safety_events.sql | 25 +++- ...y_modal_time_series_safety_and_service.sql | 78 ++++++++++- ...ct_nonmajor_safety_and_security_events.sql | 123 +++++++++++++++++- 4 files changed, 316 insertions(+), 4 deletions(-) diff --git a/warehouse/models/mart/ntd_safety_and_security/fct_fra_regulated_mode_major_security_events.sql b/warehouse/models/mart/ntd_safety_and_security/fct_fra_regulated_mode_major_security_events.sql index d57af421cc..8d8e306263 100644 --- a/warehouse/models/mart/ntd_safety_and_security/fct_fra_regulated_mode_major_security_events.sql +++ b/warehouse/models/mart/ntd_safety_and_security/fct_fra_regulated_mode_major_security_events.sql @@ -8,4 +8,96 @@ fct_fra_regulated_mode_major_security_events AS ( FROM staging_fra_regulated_mode_major_security_events ) -SELECT * FROM fct_fra_regulated_mode_major_security_events +SELECT + other_vehicle_action, + manufacturer_description, + evacuation_comment, + manufacturer, + non_rail_transit_vehicle, + fuel_type, + transit_y_n, + evacuation_location, + rail_alignment, + path_condition, + weather, + collision_with, + fire_type, + suicide_serious_injuries, + other_serious_injuries, + other_injuries, + occupant_of_other_vehicle_2, + other_involved_veh, + vehicle_speed, + occupant_of_other_vehicle_1, + pedestrian_walking_along_1, + vehicle_action, + pedestrian_crossing_tracks_1, + pedestrian_not_in_crosswalk_1, + pedestrian_in_crosswalk_2, + pedestrian_in_crosswalk_1, + rail_bus_ferry, + people_waiting_or_leaving, + other_worker_serious_injuries, + transit_employee_injuries, + configuration, + transit_vehicle_rider_serious, + longitude, + occupant_of_other_vehicle, + pedestrian_crossing_tracks, + latitude, + lighting, + people_waiting_or_leaving_2, + other_worker_injuries, + transit_vehicle_rider_injuries, + suicide_fatalities, + transit_vehicle_rider, + pedestrian_in_crosswalk, + action_type, + bicyclist_serious_injuries, + total_fatalities, + people_waiting_or_leaving_1, + pedestrian_crossing_tracks_2, + bicyclist_fatalities, + safety_security, + transit_employee_fatalities, + transit_vehicle_operator, + property_damage_type, + transit_employee_serious, + rail_grade_crossing_control, + intentional_y_n, + total_injuries, + event_type, + event_location, + number_of_vehicles_involved, + suicide_injuries, + pedestrian_walking_along, + person_list, + type_of_service, + mode, + self_evacuation_y_n, + bicyclist_injuries, + property_damage, + pedestrian_not_in_crosswalk_2, + fixed_route_flag, + transit_vehicle_operator_1, + incident_description, + incident_date, + approximate_address, + other_worker_fatalities, + incident_time, + pedestrian_walking_along_2, + towed_y_n, + agency, + right_of_way_condition, + fire_fuel, + number_of_transit_vehicles, + year, + transit_vehicle_operator_2, + incident_number, + other_fatalities, + pedestrian_not_in_crosswalk, + number_of_derailed_cars, + ntd_id, + dt, + execution_ts +FROM fct_fra_regulated_mode_major_security_events diff --git a/warehouse/models/mart/ntd_safety_and_security/fct_major_safety_events.sql b/warehouse/models/mart/ntd_safety_and_security/fct_major_safety_events.sql index 1cb061a1ce..1f9493207c 100644 --- a/warehouse/models/mart/ntd_safety_and_security/fct_major_safety_events.sql +++ b/warehouse/models/mart/ntd_safety_and_security/fct_major_safety_events.sql @@ -8,4 +8,27 @@ fct_major_safety_events AS ( FROM staging_major_safety_events ) -SELECT * FROM fct_major_safety_events +SELECT + other, + worker, + minor_nonphysical_assaults_on_other_transit_workers, + total_injuries, + non_physical_assaults_on_operators_security_events_only_, + total_incidents, + minor_physical_assaults_on_operators, + minor_physical_assaults_on_other_transit_workers, + location_group, + location, + eventtype, + additional_assault_information, + sftsecfl, + yr, + modecd, + mo, + typeofservicecd, + reportername, + customer, + ntdid, + dt, + execution_ts +FROM fct_major_safety_events diff --git a/warehouse/models/mart/ntd_safety_and_security/fct_monthly_modal_time_series_safety_and_service.sql b/warehouse/models/mart/ntd_safety_and_security/fct_monthly_modal_time_series_safety_and_service.sql index e7fad5efd5..ee9fc2ec08 100644 --- a/warehouse/models/mart/ntd_safety_and_security/fct_monthly_modal_time_series_safety_and_service.sql +++ b/warehouse/models/mart/ntd_safety_and_security/fct_monthly_modal_time_series_safety_and_service.sql @@ -8,4 +8,80 @@ fct_monthly_modal_time_series_safety_and_service AS ( FROM staging_monthly_modal_time_series_safety_and_service ) -SELECT * FROM fct_monthly_modal_time_series_safety_and_service +SELECT + major_non_physical_assaults_on_operators, + major_non_physical_assaults_on_other_transit_workers, + major_physical_assaults_on_operators, + non_major_non_physical_assaults_on_other_transit_workers, + non_major_physical_assaults_on_other_transit_workers, + non_major_non_physical_assaults_on_operators, + total_injuries, + trespasser_injuries, + other_injuries, + other_vehicle_occupant_1, + pedestrian_walking_along_1, + pedestrian_in_corsswalk, + bicyclist_injuries, + other_worker_injuries, + total_employee_injuries, + other_employee_injuries, + operator_injuries, + total_other_fatalities, + other_vehicle_occupant, + people_waiting_or_leaving_1, + total_fatalities, + trespasser_fatalities, + suicide_injuries, + collisions_with_other, + pedestrian_walking_along, + suicide_fatalities, + pedestrian_in_crosswalk, + bicyclist_fatalities, + other_worker_fatalities, + type_of_service, + mode, + passenger_fatalities, + total_employee_fatalities, + operator_fatalities, + people_waiting_or_leaving, + uace_code, + month, + total_events_not_otherwise, + primary_uza_population, + collisions_with_bus_vehicle, + total_security_events, + total_events, + rail_y_n, + total_fires, + total_derailments, + pedestrian_crossing_tracks, + total_assaults_on_transit_workers, + total_collisions, + agency, + collisions_with_rail_vehicle, + passenger_injuries, + collisions_with_fixed_object, + ridership, + service_area_population, + collisions_with_person, + major_physical_assaults_on_other_transit_workers, + collisions_with_motor_vehicle, + service_area_sq_miles, + other_employee_fatalities, + non_major_physical_assaults_on_operators, + year, + vehicle_revenue_hours, + pedestrian_not_in_crosswalk_1, + vehicle_revenue_miles, + vehicles, + organization_type, + pedestrian_crossing_tracks_1, + primary_uza_sq_miles, + primary_uza_name, + _5_digit_ntd_id, + total_other_injuries, + other_fatalities, + pedestrian_not_in_crosswalk, + dt, + execution_ts +FROM fct_monthly_modal_time_series_safety_and_service diff --git a/warehouse/models/mart/ntd_safety_and_security/fct_nonmajor_safety_and_security_events.sql b/warehouse/models/mart/ntd_safety_and_security/fct_nonmajor_safety_and_security_events.sql index f81b20ad15..5e5fab40d4 100644 --- a/warehouse/models/mart/ntd_safety_and_security/fct_nonmajor_safety_and_security_events.sql +++ b/warehouse/models/mart/ntd_safety_and_security/fct_nonmajor_safety_and_security_events.sql @@ -8,4 +8,125 @@ fct_nonmajor_safety_and_security_events AS ( FROM staging_nonmajor_safety_and_security_events ) -SELECT * FROM fct_nonmajor_safety_and_security_events +SELECT + other_fire_fuel_description, + operator_location, + tide, + current_condition, + runaway_train_flag, + track_configuration, + hazmat_type, + fire_fuel, + fire_type, + rail_grade_crossing_control, + incident_number, + manufacturer, + non_rail_transit_vehicle, + derailed_cars_count, + fuel_type, + transit_y_n, + evacuation, + path_condition, + suicide_fatalities, + weather, + collision_with, + other_event_type_description, + total_serious_injuries, + transit_vehicle_operator_2, + property_damage, + trespasser_inuries_subtotal_, + bicyclist_serious_injuries, + suicide_serious_injuries, + transit_vehicle_rider, + other_serious_injuries, + evacuation_location, + other_injuries, + occupant_of_other_vehicle_2, + pedestrian_walking_along_1, + vehicle_action, + pedestrian_crossing_tracks_1, + hazmat_type_description, + pedestrian_not_in_crosswalk_1, + pederstiran_in_crosswalk, + __computed_region_8fe2_rd7y, + bicyclist_injuries, + _5_digit_ntd_id, + transit_employee_serious, + transit_employee_injuries, + trespasser_serious_injuries_subtotal_, + transit_vehicle_rider_serious, + intentional_y_n, + transit_vehicle_rider_injuries, + trespasser_fatalities_subtotal_, + other_fatalities, + longitude, + occupant_of_other_vehicle, + evacuation_comment, + latitude, + pedestrian_crossing_tracks, + rail_alignment, + pedestrian_in_crosswalk, + safety_security, + transit_employee_fatalities, + revenue_vehicle_identifier_list, + manufacturer_description, + transit_vehicle_operator, + evac_to_right_of_way, + event_type, + total_injuries, + life_safety_y_n, + latlon, + lighting, + other_worker_injuries, + people_waiting_or_leaving_2, + location_type, + pedestrian_crossing_tracks_2, + bicyclist_fatalities, + number_of_cars_on_involved_transit_vehicles, + number_of_vehicles_involved, + approximate_address, + __computed_region_m2nu_4dib, + derailment_type, + suicide_injuries, + mode_name, + pedestrian_walking_along, + assault_homicide_transit_worker_flag, + action_type, + people_waiting_or_leaving_1, + property_damage_type, + total_fatalities, + road_configuration, + self_evacuation_y_n, + incident_time, + person_list, + type_of_service, + vehicle_speed, + mode, + other_worker_serious_injuries, + rail_bus_ferry, + transit_vehicle_operator_1, + people_waiting_or_leaving, + pedestrian_not_in_crosswalk_2, + fixed_route_flag, + event_category, + assault_homicide_type_desc, + event_type_group, + other_worker_fatalities, + incident_description, + pederstiran_in_crosswalk_1, + assault_homicide_person_type_desc, + service_stop_control_device, + incident_date, + pedestrian_walking_along_2, + towed_y_n, + agency, + intersection, + occupant_of_other_vehicle_1, + pedestrian_not_in_crosswalk, + right_of_way_condition, + number_of_transit_vehicles, + year, + uace_code, + dt, + execution_ts +FROM fct_nonmajor_safety_and_security_events From b9bc4eccb4e95cbcce099e5e52579196577d752a Mon Sep 17 00:00:00 2001 From: Charles Costanzo Date: Mon, 16 Dec 2024 19:19:50 -0500 Subject: [PATCH 5/6] slightly change contractual relationships external table name --- ...ml => 2023__annual_database_contractual_relationships.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename airflow/dags/create_external_tables/ntd_data_products/{2023__annual_database_contractual_relationship.yml => 2023__annual_database_contractual_relationships.yml} (85%) diff --git a/airflow/dags/create_external_tables/ntd_data_products/2023__annual_database_contractual_relationship.yml b/airflow/dags/create_external_tables/ntd_data_products/2023__annual_database_contractual_relationships.yml similarity index 85% rename from airflow/dags/create_external_tables/ntd_data_products/2023__annual_database_contractual_relationship.yml rename to airflow/dags/create_external_tables/ntd_data_products/2023__annual_database_contractual_relationships.yml index 6fb13cc0be..6b7760b716 100644 --- a/airflow/dags/create_external_tables/ntd_data_products/2023__annual_database_contractual_relationship.yml +++ b/airflow/dags/create_external_tables/ntd_data_products/2023__annual_database_contractual_relationships.yml @@ -3,11 +3,11 @@ bucket: gs://test-calitp-ntd-xlsx-products-clean prefix_bucket: false post_hook: | SELECT * - FROM `{{ get_project_id() }}`.external_ntd__annual_reporting.2023__annual_database_contractual_relationship + FROM `{{ get_project_id() }}`.external_ntd__annual_reporting.2023__annual_database_contractual_relationships LIMIT 1; source_objects: - "annual_database_contractual_relationship/2023/contractual_relationships/*.jsonl.gz" -destination_project_dataset_table: "external_ntd__annual_reporting.2023__annual_database_contractual_relationship" +destination_project_dataset_table: "external_ntd__annual_reporting.2023__annual_database_contractual_relationships" source_format: NEWLINE_DELIMITED_JSON use_bq_client: true hive_options: From e92ffb429934473df2f191993398afe83a53c1c0 Mon Sep 17 00:00:00 2001 From: Charles Costanzo Date: Mon, 16 Dec 2024 19:35:10 -0500 Subject: [PATCH 6/6] fix source table names that changed somehow --- .../stg_ntd__fra_regulated_mode_major_security_events.sql | 2 +- .../ntd_safety_and_security/stg_ntd__major_safety_events.sql | 2 +- .../stg_ntd__monthly_modal_time_series_safety_and_service.sql | 2 +- .../stg_ntd__nonmajor_safety_and_security_events.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql index c29f0d9afe..7efa2efd87 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__fra_regulated_mode_major_security_events.sql @@ -1,6 +1,6 @@ WITH external_fra_regulated_mode_major_security_events AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'multi_year__fra_regulated_mode_major_security_events') }} + FROM {{ source('external_ntd__safety_and_security', 'historical__fra_regulated_mode_major_security_events') }} ), get_latest_extract AS( diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql index f35a845d07..a11610063f 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__major_safety_events.sql @@ -1,6 +1,6 @@ WITH external_major_safety_events AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'multi_year__major_safety_events') }} + FROM {{ source('external_ntd__safety_and_security', 'historical__major_safety_events') }} ), get_latest_extract AS( diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql index 8add493dbb..62852baaa0 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__monthly_modal_time_series_safety_and_service.sql @@ -1,6 +1,6 @@ WITH external_monthly_modal_time_series_safety_and_service AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'multi_year__monthly_modal_time_series_safety_and_service') }} + FROM {{ source('external_ntd__safety_and_security', 'historical__monthly_modal_time_series_safety_and_service') }} ), get_latest_extract AS( diff --git a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql index 94eeed0159..84408fd844 100644 --- a/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql +++ b/warehouse/models/staging/ntd_safety_and_security/stg_ntd__nonmajor_safety_and_security_events.sql @@ -1,6 +1,6 @@ WITH external_nonmajor_safety_and_security_events AS ( SELECT * - FROM {{ source('external_ntd__safety_and_security', 'multi_year__nonmajor_safety_and_security_events') }} + FROM {{ source('external_ntd__safety_and_security', 'historical__nonmajor_safety_and_security_events') }} ), get_latest_extract AS(