Skip to content

Commit

Permalink
#905 sqlfluff
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwol committed Jul 10, 2024
1 parent 0c8a8b4 commit 053f960
Showing 1 changed file with 224 additions and 102 deletions.
326 changes: 224 additions & 102 deletions volumes/miovision/sql/open_data/create-view-miovision_wide_tmc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,145 +10,261 @@ CREATE OR REPLACE VIEW gwolofs.miovision_open_data_wide_15min AS (
SELECT
v.intersection_uid,
v.datetime_bin,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'S'

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 indent of 12 spaces.
), 0) AS sb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'S'
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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'S'

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 indent of 12 spaces.
), 0) AS sb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'S'

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 indent of 12 spaces.
), 0) AS sb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'N'

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 indent of 12 spaces.
), 0) AS nb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'N'
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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'N'

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 indent of 12 spaces.
), 0) AS nb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'N'

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 indent of 12 spaces.
), 0) AS nb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'W'

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 indent of 12 spaces.
), 0) AS wb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'W'
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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'W'

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 indent of 12 spaces.
), 0) AS wb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'W'

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 indent of 12 spaces.
), 0) AS wb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'E'

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 indent of 12 spaces.
), 0) AS eb_car_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'E'
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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'E'

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 indent of 12 spaces.
), 0) AS eb_car_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[1]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[1]::int [])

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 indent of 12 spaces.
AND v.leg = 'E'

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 indent of 12 spaces.
), 0) AS eb_car_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

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 indent of 12 spaces.
AND v.leg = 'S'

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 indent of 12 spaces.
), 0) AS sb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

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 indent of 12 spaces.
AND v.leg = 'S'

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 indent of 12 spaces.
), 0) AS sb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

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 indent of 12 spaces.
AND v.leg = 'S'

Check failure on line 101 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 indent of 12 spaces.
), 0) AS sb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

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

LT02: Expected indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

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

LT02: Expected indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 107 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 indent of 12 spaces.
), 0) AS nb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

Check failure on line 111 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure on line 112 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 indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 113 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 indent of 12 spaces.
), 0) AS nb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

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

LT02: Expected indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure on line 118 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 indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 119 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 indent of 12 spaces.
), 0) AS nb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

Check failure on line 123 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure 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

LT02: Expected indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 125 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 indent of 12 spaces.
), 0) AS wb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

Check failure on line 129 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure on line 130 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 indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 131 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 indent of 12 spaces.
), 0) AS wb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

Check failure on line 135 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure on line 136 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 indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 137 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 indent of 12 spaces.
), 0) AS wb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

Check failure on line 141 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure on line 142 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure on line 143 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 indent of 12 spaces.
), 0) AS eb_truck_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

Check failure on line 147 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure on line 148 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure on line 149 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 indent of 12 spaces.
), 0) AS eb_truck_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

Check failure on line 153 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[4, 5, 9]::int [])

Check failure on line 154 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure 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

LT02: Expected indent of 12 spaces.
), 0) AS eb_truck_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

Check failure on line 159 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 160 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 indent of 12 spaces.
AND v.leg = 'S'

Check failure on line 161 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 indent of 12 spaces.
), 0) AS sb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

Check failure on line 165 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 166 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 indent of 12 spaces.
AND v.leg = 'S'

Check failure on line 167 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 indent of 12 spaces.
), 0) AS sb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

Check failure on line 171 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 172 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 indent of 12 spaces.
AND v.leg = 'S'

Check failure on line 173 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 indent of 12 spaces.
), 0) AS sb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

Check failure on line 177 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 178 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 indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 179 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 indent of 12 spaces.
), 0) AS nb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

Check failure on line 183 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 184 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 indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 185 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 indent of 12 spaces.
), 0) AS nb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

Check failure on line 189 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 190 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 indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 191 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 indent of 12 spaces.
), 0) AS nb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

Check failure on line 195 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 196 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 indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 197 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 indent of 12 spaces.
), 0) AS wb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

Check failure on line 201 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 202 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 indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 203 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 indent of 12 spaces.
), 0) AS wb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

Check failure on line 207 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 208 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 indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 209 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 indent of 12 spaces.
), 0) AS wb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 3 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 3

Check failure on line 213 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 214 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure on line 215 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 indent of 12 spaces.
), 0) AS eb_bus_r,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 1 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 1

Check failure on line 219 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 220 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure on line 221 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 indent of 12 spaces.
), 0) AS eb_bus_t,
COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = 2 AND v.classification_uid = ANY(ARRAY[3]::int []) AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = 2

Check failure on line 225 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 indent of 12 spaces.
AND v.classification_uid = ANY(ARRAY[3]::int [])

Check failure on line 226 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure on line 227 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 indent of 12 spaces.
), 0) AS eb_bus_l,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 6
AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 6

Check failure on line 231 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 indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 232 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 indent of 12 spaces.
), 0) AS nx_peds,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 6
AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 6

Check failure on line 236 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 indent of 12 spaces.
AND v.leg = 'S'

Check failure on line 237 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 indent of 12 spaces.
), 0) AS sx_peds,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 6
AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 6

Check failure on line 241 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure on line 242 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 indent of 12 spaces.
), 0) AS ex_peds,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 6
AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 6

Check failure on line 246 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 indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 247 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 indent of 12 spaces.
), 0) AS wx_peds,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 2
AND v.leg = 'N'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 2

Check failure on line 251 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 indent of 12 spaces.
AND v.leg = 'N'

Check failure on line 252 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 indent of 12 spaces.
), 0) AS nx_bike,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 2
AND v.leg = 'S'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 2

Check failure on line 256 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 indent of 12 spaces.
AND v.leg = 'S'

Check failure on line 257 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 indent of 12 spaces.
), 0) AS sx_bike,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 2
AND v.leg = 'E'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 2

Check failure on line 261 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 indent of 12 spaces.
AND v.leg = 'E'

Check failure on line 262 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 indent of 12 spaces.
), 0) AS ex_bike,
COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = 2
AND v.leg = 'W'
COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = 2

Check failure on line 266 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 indent of 12 spaces.
AND v.leg = 'W'

Check failure on line 267 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 indent of 12 spaces.
), 0) AS wx_bike
FROM miovision_api.volumes_15min_mvt AS v
--JOIN miovision_api.classifications AS c USING (classification_uid)
Expand All @@ -172,11 +288,14 @@ SELECT * FROM gwolofs.miovision_open_data_wide_15min LIMIT 10000; --noqa: L044
SELECT col_name FROM (
SELECT
'COALESCE(SUM(v.volume) FILTER (WHERE
v.movement_uid = ' || movement_uid::text ||
'COALESCE(SUM(v.volume) FILTER (
WHERE
v.movement_uid = '
|| movement_uid::text ||
' AND v.classification_uid = ANY(
ARRAY[' || string_agg(classification_uid::text, ',') || ']::int [])' ||
' AND v.leg = ''' || leg || '''
'
AND v.leg = ''' || leg || '''
), 0) AS ' ||
dir || '_' ||
CASE classification WHEN 'Light' THEN 'car' WHEN 'Bus' THEN 'bus'
Expand Down Expand Up @@ -214,9 +333,12 @@ UNION ALL
SELECT col_name FROM (
SELECT
'COALESCE(SUM(v.volume) FILTER (WHERE
v.classification_uid = ' || classification_uid::text ||
' AND v.leg = ''' || leg || '''
'COALESCE(SUM(v.volume) FILTER (
WHERE
v.classification_uid = '
|| classification_uid::text ||
'
AND v.leg = ''' || leg || '''
), 0) AS ' ||
dir || '_' ||
CASE classification WHEN 'Bicycle' THEN 'bike'
Expand Down

0 comments on commit 053f960

Please sign in to comment.