@golemio/rush-hour-aggregation 1.3.1-dev.2437452247 → 1.3.1-dev.2460426119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/rush-hour-aggregation",
3
- "version": "1.3.1-dev.2437452247",
3
+ "version": "1.3.1-dev.2460426119",
4
4
  "description": "Rush hour data aggregation for Praha dopravní project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,7 +43,7 @@ select
43
43
  ) as properties
44
44
  from
45
45
  (
46
- select
46
+ select distinct on (gs.gs, nti.situation_id, nti.situation_record_type)
47
47
  (date_part('epoch'::text, gs.gs) * 1000::double precision)::bigint as measured_at,
48
48
  gs.gs,
49
49
  nti.general_public_comment,
@@ -72,17 +72,12 @@ from
72
72
  join ndic.ndic_traffic_info nti on
73
73
  gs.gs >= nti.validity_overall_start_time
74
74
  and gs.gs <= nti.validity_overall_end_time
75
- and nti.situation_version::text = ((
76
- select
77
- max(nti2.situation_version::text) as max
78
- from
79
- ndic.ndic_traffic_info nti2
80
- where
81
- nti2.situation_id::text = nti.situation_id::text
82
- and nti2.situation_record_type::text = nti.situation_record_type::text
83
- and nti2.situation_version::text = nti.situation_version::text
84
- and nti2.source::text = nti.source::text
85
- and nti.situation_version_time <= gs.gs
86
- and nti.global_network_linear is not null
87
- ))
75
+ and nti.situation_version_time <= gs.gs
76
+ and nti.global_network_linear is not null
77
+ order by
78
+ gs.gs,
79
+ nti.situation_id,
80
+ nti.situation_record_type,
81
+ nti.situation_version::bigint desc
88
82
  ) t
83
+ order by t.situation_id, t.situation_record_type, t.situation_version_time, t.measured_at