-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix data type errors creating nonmajor_safety_and_security_events tables
[#3745]
- Loading branch information
Showing
3 changed files
with
227 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
217 changes: 108 additions & 109 deletions
217
warehouse/models/mart/ntd_safety_and_security/fct_nonmajor_safety_and_security_events.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,131 @@ | ||
WITH staging_nonmajor_safety_and_security_events AS ( | ||
WITH fct_nonmajor_safety_and_security_events AS ( | ||
SELECT * | ||
FROM {{ ref('stg_ntd__nonmajor_safety_and_security_events') }} | ||
), | ||
|
||
fct_nonmajor_safety_and_security_events AS ( | ||
SELECT * | ||
FROM staging_nonmajor_safety_and_security_events | ||
) | ||
|
||
SELECT | ||
ntd_id, | ||
agency, | ||
uace_code, | ||
mode, | ||
mode_name, | ||
type_of_service, | ||
year, | ||
fixed_route_flag, | ||
incident_description, | ||
incident_number, | ||
incident_date, | ||
incident_time, | ||
event_type, | ||
event_type_group, | ||
event_category, | ||
safety_security, | ||
collision_with, | ||
property_damage, | ||
property_damage_type, | ||
location_type, | ||
multiple_locations_list, | ||
latitude, | ||
longitude, | ||
latlon, | ||
approximate_address, | ||
total_injuries, | ||
total_fatalities, | ||
number_of_transit_vehicles, | ||
number_of_vehicles_involved, | ||
number_of_cars_on_involved_transit_vehicles, | ||
derailed_cars_count, | ||
other_vehicle_type_list, | ||
evacuation, | ||
evac_to_right_of_way, | ||
evacuation_comment, | ||
evacuation_location, | ||
towed_y_n, | ||
life_safety_y_n, | ||
self_evacuation_y_n, | ||
intentional_y_n, | ||
transit_y_n, | ||
hazmat_type, | ||
hazmat_type_description, | ||
fire_type, | ||
fire_fuel, | ||
other_fire_fuel_description, | ||
operator_location, | ||
tide, | ||
weather, | ||
weather_comment, | ||
lighting, | ||
current_condition, | ||
runaway_train_flag, | ||
tide, | ||
road_configuration, | ||
track_configuration, | ||
hazmat_type, | ||
fire_fuel, | ||
fire_type, | ||
path_condition, | ||
rail_alignment, | ||
rail_grade_crossing_control, | ||
incident_number, | ||
manufacturer, | ||
non_rail_transit_vehicle, | ||
derailed_cars_count, | ||
rail_grade_crossing_comment, | ||
rail_bus_ferry, | ||
runaway_train_flag, | ||
right_of_way_condition, | ||
intersection, | ||
service_stop_control_device, | ||
operator_location, | ||
vehicle_action, | ||
action_type, | ||
derailment_type, | ||
fuel_type, | ||
transit_y_n, | ||
evacuation, | ||
path_condition, | ||
suicide_fatalities, | ||
weather, | ||
collision_with, | ||
vehicle_speed, | ||
non_rail_transit_vehicle, | ||
non_transit_vehicle_action_list, | ||
manufacturer, | ||
manufacturer_description, | ||
assault_homicide_person_type_desc, | ||
assault_homicide_type_desc, | ||
assault_homicide_transit_worker_flag, | ||
other_event_type_description, | ||
total_serious_injuries, | ||
transit_vehicle_operator_2, | ||
property_damage, | ||
trespasser_inuries_subtotal_, | ||
bicyclist_fatalities, | ||
bicyclist_injuries, | ||
bicyclist_serious_injuries, | ||
suicide_serious_injuries, | ||
transit_vehicle_rider, | ||
other_serious_injuries, | ||
evacuation_location, | ||
other_injuries, | ||
occupant_of_other_vehicle, | ||
occupant_of_other_vehicle_1, | ||
occupant_of_other_vehicle_2, | ||
pedestrian_walking_along_1, | ||
vehicle_action, | ||
pedestrian_crossing_tracks_1, | ||
hazmat_type_description, | ||
pedestrian_not_in_crosswalk_1, | ||
pedestrian_in_crosswalk, | ||
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, | ||
pederstiran_in_crosswalk_1, | ||
pedestrian_not_in_crosswalk, | ||
pedestrian_not_in_crosswalk_1, | ||
pedestrian_not_in_crosswalk_2, | ||
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_1, | ||
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, | ||
pedestrian_walking_along_1, | ||
pedestrian_walking_along_2, | ||
people_waiting_or_leaving, | ||
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, | ||
people_waiting_or_leaving_2, | ||
suicide_fatalities, | ||
suicide_injuries, | ||
suicide_serious_injuries, | ||
transit_employee_fatalities, | ||
transit_employee_injuries, | ||
transit_employee_serious, | ||
transit_vehicle_type, | ||
transit_vehicle_operator, | ||
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, | ||
transit_vehicle_operator_2, | ||
transit_vehicle_rider, | ||
transit_vehicle_rider_injuries, | ||
transit_vehicle_rider_serious, | ||
trespasser_fatalities_subtotal_, | ||
trespasser_inuries_subtotal_, | ||
trespasser_serious_injuries_subtotal_, | ||
other_fatalities, | ||
other_injuries, | ||
other_serious_injuries, | ||
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, | ||
other_worker_injuries, | ||
other_worker_serious_injuries, | ||
total_serious_injuries, | ||
person_list, | ||
revenue_vehicle_identifier_list, | ||
dt, | ||
execution_ts | ||
FROM fct_nonmajor_safety_and_security_events |
Oops, something went wrong.