Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTD: add explicit column names to ntd annual reporting and safety/security tables #3588

Merged
merged 6 commits into from
Dec 17, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 33 additions & 1 deletion warehouse/models/mart/ntd_annual_reporting/fct_breakdowns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading
Loading