Skip to content

Commit

Permalink
#905 fluff
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwol committed Mar 26, 2024
1 parent 88f3260 commit 5e578a4
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
--Include/Exclude buses/streetcars?
--Decision to not include manual anomalous_range 'valid_caveat' notes: SELECT
--Including entry/exit information to satisfy ATR related DRs.
--> providing exit leg and direction as extra columns rather
-- than extra rows to reduce potential for double counting.
-->> providing exit leg and direction as extra columns rather
-->> than extra rows to reduce potential for double counting.

--DROP FUNCTION gwolofs.insert_miovision_15min_open_data;

CREATE OR REPLACE FUNCTION gwolofs.insert_miovision_15min_open_data(
_date date,
intersections integer[] DEFAULT ARRAY[]::integer[])
RETURNS void
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
_date date,
integer [] DEFAULT ARRAY[]::integer []
)
RETURNS void
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
AS $BODY$

DECLARE
Expand Down Expand Up @@ -136,19 +137,19 @@ AS $BODY$
END;
$BODY$;

ALTER FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer[])
ALTER FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer [])
OWNER TO gwolofs;

GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer[])
GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer [])
TO miovision_admins;

GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer[])
GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer [])
TO miovision_api_bot;

REVOKE ALL ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer[])
FROM PUBLIC;
REVOKE ALL ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer [])
FROM public;

COMMENT ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer[])
COMMENT ON FUNCTION gwolofs.insert_miovision_15min_open_data(date, integer [])
IS 'Function for first deleting then inserting monthly 15
minute open data volumes into gwolofs.miovision_15min_open_data.
Contains an optional intersection parameter in case one just one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
--DROP FUNCTION gwolofs.insert_miovision_open_data_monthly_summary;

CREATE OR REPLACE FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(
_date date,
intersections integer[] DEFAULT ARRAY[]::integer[])
RETURNS void
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
_date date,
intersections integer [] DEFAULT ARRAY[]::integer []
)
RETURNS void
LANGUAGE 'plpgsql'
COST 100
VOLATILE PARALLEL UNSAFE
AS $BODY$

DECLARE
Expand Down Expand Up @@ -180,19 +181,19 @@ AS $BODY$
END;
$BODY$;

ALTER FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer[])
ALTER FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer [])
OWNER TO gwolofs;

GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer[])
GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer [])
TO miovision_admins;

GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer[])
GRANT EXECUTE ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer [])
TO miovision_api_bot;

REVOKE ALL ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer[])
FROM PUBLIC;
REVOKE ALL ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer [])
FROM public;

COMMENT ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer[])
COMMENT ON FUNCTION gwolofs.insert_miovision_open_data_monthly_summary(date, integer [])
IS 'Function for first deleting then inserting monthly summary miovision
open data into gwolofs.miovision_open_data_monthly_summary.
Contains an optional intersection parameter in case one just one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ TABLESPACE pg_default;
CREATE INDEX miovision_15min_od_dt_idx ON
gwolofs.miovision_15min_open_data USING brin (datetime_15min);

ALTER TABLE IF EXISTS gwolofs.miovision_15min_open_data
ALTER TABLE IF EXISTS gwolofs.miovision_15min_open_data
OWNER TO gwolofs;

REVOKE ALL ON TABLE gwolofs.miovision_15min_open_data FROM bdit_humans;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TABLESPACE pg_default;
CREATE INDEX miovision_monthly_od_dt_idx ON
gwolofs.miovision_open_data_monthly_summary USING brin (mnth);

ALTER TABLE IF EXISTS gwolofs.miovision_open_data_monthly_summary
ALTER TABLE IF EXISTS gwolofs.miovision_open_data_monthly_summary
OWNER TO gwolofs;

REVOKE ALL ON TABLE gwolofs.miovision_open_data_monthly_summary FROM bdit_humans;
Expand Down
179 changes: 112 additions & 67 deletions volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql
Original file line number Diff line number Diff line change
@@ -1,72 +1,117 @@
--Would prefer to omit this, unless we *really* want it for comparison with existing short term TMC open data.
--Would prefer to omit this, unless we *really* want it for
--comparison with existing short term TMC open data.

--include u-turns?
--bikes
--motorized vehicles/streetcars?

CREATE OR REPLACE VIEW gwolofs.miovision_open_data_wide_15min AS (

SELECT
v.intersection_uid,
v.datetime_bin,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'S'), 0) AS sb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'S'), 0) AS sb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'S'), 0) AS sb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'N'), 0) AS nb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'N'), 0) AS nb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'N'), 0) AS nb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'W'), 0) AS wb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'W'), 0) AS wb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'W'), 0) AS wb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'E'), 0) AS eb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'E'), 0) AS eb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[1]::int []) AND leg = 'E'), 0) AS eb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'S'), 0) AS sb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'S'), 0) AS sb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'S'), 0) AS sb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'N'), 0) AS nb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'N'), 0) AS nb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'N'), 0) AS nb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'W'), 0) AS wb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'W'), 0) AS wb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'W'), 0) AS wb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'E'), 0) AS eb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'E'), 0) AS eb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[4,5,9]::int []) AND leg = 'E'), 0) AS eb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'S'), 0) AS sb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'S'), 0) AS sb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'S'), 0) AS sb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'N'), 0) AS nb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'N'), 0) AS nb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'N'), 0) AS nb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'W'), 0) AS wb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'W'), 0) AS wb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'W'), 0) AS wb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 3 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'E'), 0) AS eb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 1 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'E'), 0) AS eb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = 2 AND classification_uid = ANY (ARRAY[3]::int []) AND leg = 'E'), 0) AS eb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 6 AND leg = 'N'), 0) AS nx_peds,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 6 AND leg = 'S'), 0) AS sx_peds,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 6 AND leg = 'E'), 0) AS ex_peds,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 6 AND leg = 'W'), 0) AS wx_peds,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 2 AND leg = 'N'), 0) AS nx_bike,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 2 AND leg = 'S'), 0) AS sx_bike,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 2 AND leg = 'E'), 0) AS ex_bike,
COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = 2 AND leg = 'W'), 0) AS wx_bike
FROM miovision_api.volumes_15min_mvt AS v
JOIN miovision_api.classifications AS c USING (classification_uid)
JOIN miovision_api.movements AS m USING (movement_uid)
WHERE
datetime_bin >= '2024-02-01'::date
AND datetime_bin < '2024-03-01'::date
--AND intersection_uid = 1
--AND classification_uid NOT IN (2,10) --exclude bikes due to reliability
GROUP BY
v.intersection_uid,
v.datetime_bin
ORDER BY
v.intersection_uid,
v.datetime_bin
SELECT
v.intersection_uid,
v.datetime_bin,
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 13 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'S'), 0) AS sb_car_r,

Check failure on line 14 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 15 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'S'), 0) AS sb_car_t,

Check failure on line 16 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 17 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'S'), 0) AS sb_car_l,

Check failure on line 18 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 19 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'N'), 0) AS nb_car_r,

Check failure on line 20 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 21 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'N'), 0) AS nb_car_t,

Check failure on line 22 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 23 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'N'), 0) AS nb_car_l,

Check failure on line 24 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 25 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'W'), 0) AS wb_car_r,

Check failure on line 26 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 27 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'W'), 0) AS wb_car_t,

Check failure on line 28 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 29 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'W'), 0) AS wb_car_l,

Check failure on line 30 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 31 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'E'), 0) AS eb_car_r,

Check failure on line 32 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 33 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'E'), 0) AS eb_car_t,

Check failure on line 34 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 35 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'E'), 0) AS eb_car_l,

Check failure on line 36 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 37 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'S'), 0) AS sb_truck_r,

Check notice on line 38 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 38 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 38 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 39 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'S'), 0) AS sb_truck_t,

Check notice on line 40 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 40 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 40 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 41 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'S'), 0) AS sb_truck_l,

Check notice on line 42 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 42 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 42 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 43 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'N'), 0) AS nb_truck_r,

Check notice on line 44 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 44 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 44 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 45 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'N'), 0) AS nb_truck_t,

Check notice on line 46 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 46 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 46 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 47 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'N'), 0) AS nb_truck_l,

Check notice on line 48 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 48 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 48 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 49 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'W'), 0) AS wb_truck_r,

Check notice on line 50 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 50 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 50 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 51 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'W'), 0) AS wb_truck_t,

Check notice on line 52 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 52 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 52 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 53 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'W'), 0) AS wb_truck_l,

Check notice on line 54 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 54 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 54 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 55 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'E'), 0) AS eb_truck_r,

Check notice on line 56 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 56 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 56 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 57 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'E'), 0) AS eb_truck_t,

Check notice on line 58 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 58 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 58 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 59 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[4,5,9]::int []) AND v.leg = 'E'), 0) AS eb_truck_l,

Check notice on line 60 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check notice on line 60 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Expected single whitespace between comma ',' and numeric literal.

Check failure on line 60 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 61 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'S'), 0) AS sb_bus_r,

Check failure on line 62 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 63 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'S'), 0) AS sb_bus_t,

Check failure on line 64 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 65 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'S'), 0) AS sb_bus_l,

Check failure on line 66 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 67 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'N'), 0) AS nb_bus_r,

Check failure on line 68 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 69 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'N'), 0) AS nb_bus_t,

Check failure on line 70 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 71 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'N'), 0) AS nb_bus_l,

Check failure on line 72 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 73 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'W'), 0) AS wb_bus_r,

Check failure on line 74 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 75 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'W'), 0) AS wb_bus_t,

Check failure on line 76 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 77 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'W'), 0) AS wb_bus_l,

Check failure on line 78 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 3

Check failure on line 79 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'E'), 0) AS eb_bus_r,

Check failure on line 80 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 1

Check failure on line 81 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'E'), 0) AS eb_bus_t,

Check failure on line 82 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = 2

Check failure on line 83 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'E'), 0) AS eb_bus_l,

Check failure on line 84 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 6

Check failure on line 85 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'N'), 0) AS nx_peds,

Check failure on line 86 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 6

Check failure on line 87 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'S'), 0) AS sx_peds,

Check failure on line 88 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 6

Check failure on line 89 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'E'), 0) AS ex_peds,

Check failure on line 90 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 6

Check failure on line 91 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'W'), 0) AS wx_peds,

Check failure on line 92 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 2

Check failure on line 93 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'N'), 0) AS nx_bike,

Check failure on line 94 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 2

Check failure on line 95 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'S'), 0) AS sx_bike,

Check failure on line 96 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 2

Check failure on line 97 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'E'), 0) AS ex_bike,

Check failure on line 98 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = 2

Check failure on line 99 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 12 spaces before 'v'.
AND v.leg = 'W'), 0) AS wx_bike

Check failure on line 100 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and indent of 8 spaces before ')'.
FROM miovision_api.volumes_15min_mvt AS v
JOIN miovision_api.classifications AS c USING (classification_uid)

Check failure on line 102 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

AL05: Alias 'c' is never used in SELECT statement.
JOIN miovision_api.movements AS m USING (movement_uid)

Check failure on line 103 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

AL05: Alias 'm' is never used in SELECT statement.
WHERE
datetime_bin >= '2024-02-01'::date

Check failure on line 105 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

RF02: Unqualified reference 'datetime_bin' found in select with more than one referenced table/view.
AND datetime_bin < '2024-03-01'::date

Check failure on line 106 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

RF02: Unqualified reference 'datetime_bin' found in select with more than one referenced table/view.
--AND intersection_uid = 1
--AND v.classification_uid NOT IN (2,10) --exclude bikes due to reliability
GROUP BY
v.intersection_uid,
v.datetime_bin
ORDER BY
v.intersection_uid,
v.datetime_bin
);

Check notice on line 115 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Unnecessary trailing whitespace.

SELECT * FROM gwolofs.miovision_open_data_wide_15min LIMIT 10000;

Check failure on line 117 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

AM04: Query produces an unknown number of result columns.
Expand All @@ -75,9 +120,9 @@ SELECT * FROM gwolofs.miovision_open_data_wide_15min LIMIT 10000;
SELECT col_name FROM (
SELECT
'COALESCE(SUM(v.volume) FILTER (WHERE movement_uid = ' || movement_uid::text ||
' AND classification_uid = ANY (ARRAY[' || string_agg(classification_uid::text, ',') || ']::int [])' ||
' AND leg = ''' || leg || '''), 0) AS ' ||
'COALESCE(SUM(v.volume) FILTER (WHERE v.movement_uid = ' || movement_uid::text ||
' AND v.classification_uid = ANY(ARRAY[' || string_agg(classification_uid::text, ',') || ']::int [])' ||

Check notice on line 124 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT05: Line is too long (108 > 100).
' AND v.leg = ''' || leg || '''), 0) AS ' ||
dir || '_' ||
CASE classification WHEN 'Light' THEN 'car' WHEN 'Bus' THEN 'bus' WHEN 'SingleUnitTruck' THEN 'truck' WHEN 'ArticulatedTruck' THEN 'truck' WHEN 'MotorizedVehicle' THEN 'truck' END || '_' ||

Check notice on line 127 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT05: Line is too long (193 > 100).
CASE movement_name WHEN 'left' THEN 'l' WHEN 'thru' THEN 't' WHEN 'right' THEN 'r' END || ',' AS col_name

Check notice on line 128 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT05: Line is too long (109 > 100).
Expand Down Expand Up @@ -107,8 +152,8 @@ UNION ALL
SELECT col_name FROM (
SELECT
'COALESCE(SUM(v.volume) FILTER (WHERE classification_uid = ' || classification_uid::text ||
' AND leg = ''' || leg || '''), 0) AS ' ||
'COALESCE(SUM(v.volume) FILTER (WHERE v.classification_uid = ' || classification_uid::text ||

Check notice on line 155 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT05: Line is too long (101 > 100).
' AND v.leg = ''' || leg || '''), 0) AS ' ||
dir || '_' ||
CASE classification WHEN 'Bicycle' THEN 'bike' WHEN 'Pedestrian' THEN 'peds' END || ',' AS col_name

Check notice on line 158 in volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT05: Line is too long (107 > 100).
FROM miovision_api.classifications
Expand Down

0 comments on commit 5e578a4

Please sign in to comment.