@tmlmobilidade/go-interfaces-labdb 20260903.2201.22 → 20260904.1431.46
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClickHouseInterfaceTemplate } from '../interface.template.js';
|
|
2
2
|
import { ClickHouseClient } from '@tmlmobilidade/go-clients-clickhouse';
|
|
3
|
-
import { HashedShape,
|
|
3
|
+
import { HashedShape, RideMatch, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
|
|
4
4
|
import { type Ride } from '@tmlmobilidade/go-types-operation';
|
|
5
5
|
import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
|
|
6
6
|
export declare class OperationDatabase {
|
|
@@ -21,7 +21,7 @@ export declare class OperationDatabase {
|
|
|
21
21
|
readonly rideAnalysisSimpleOneVehicleEventOrApexValidation: ClickHouseInterfaceTemplate<RideAnalysisSimpleOneVehicleEventOrApexValidation>;
|
|
22
22
|
readonly rideAnalysisSimpleThreeVehicleEvents: ClickHouseInterfaceTemplate<RideAnalysisSimpleThreeVehicleEvents>;
|
|
23
23
|
readonly rideAnalysisTransactionSequentiality: ClickHouseInterfaceTemplate<RideAnalysisTransactionSequentiality>;
|
|
24
|
-
readonly
|
|
24
|
+
readonly rideMatches: ClickHouseInterfaceTemplate<RideMatch>;
|
|
25
25
|
readonly rides: ClickHouseInterfaceTemplate<Ride>;
|
|
26
26
|
readonly simplifiedVehicleEvents: ClickHouseInterfaceTemplate<SimplifiedVehicleEvent>;
|
|
27
27
|
private readonly databaseName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { ClickHouseInterfaceTemplate } from '../interface.template.js';
|
|
3
|
-
import {
|
|
3
|
+
import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema, rideMatchesTableSchema, ridesTableSchema, simplifiedVehicleEventTableSchema } from '../schemas/operation.js';
|
|
4
4
|
/* * */
|
|
5
5
|
export class OperationDatabase {
|
|
6
6
|
//
|
|
@@ -21,7 +21,7 @@ export class OperationDatabase {
|
|
|
21
21
|
rideAnalysisSimpleOneVehicleEventOrApexValidation;
|
|
22
22
|
rideAnalysisSimpleThreeVehicleEvents;
|
|
23
23
|
rideAnalysisTransactionSequentiality;
|
|
24
|
-
|
|
24
|
+
rideMatches;
|
|
25
25
|
rides;
|
|
26
26
|
simplifiedVehicleEvents;
|
|
27
27
|
databaseName = 'operation';
|
|
@@ -111,7 +111,7 @@ export class OperationDatabase {
|
|
|
111
111
|
orderBy: ['ride_id'],
|
|
112
112
|
partitionBy: 'intDiv(operational_date, 100)',
|
|
113
113
|
});
|
|
114
|
-
this.
|
|
114
|
+
this.rideMatches = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_matches', rideMatchesTableSchema, {
|
|
115
115
|
engine: 'ReplacingMergeTree(updated_at)',
|
|
116
116
|
orderBy: ['agency_id', 'trip_id', 'window_start', 'window_end'],
|
|
117
117
|
});
|
|
@@ -144,7 +144,7 @@ export class OperationDatabase {
|
|
|
144
144
|
await this.rideAnalysisSimpleOneVehicleEventOrApexValidation.init();
|
|
145
145
|
await this.rideAnalysisSimpleThreeVehicleEvents.init();
|
|
146
146
|
await this.rideAnalysisTransactionSequentiality.init();
|
|
147
|
-
await this.
|
|
147
|
+
await this.rideMatches.init();
|
|
148
148
|
await this.rides.init();
|
|
149
149
|
await this.simplifiedVehicleEvents.init();
|
|
150
150
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ClickHouseTableSchema } from '@tmlmobilidade/go-clients-clickhouse';
|
|
2
|
-
import {
|
|
2
|
+
import { RideMatch, type HashedShape, type HashedTrip, type Ride, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
|
|
3
3
|
import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
|
|
4
4
|
export declare const simplifiedVehicleEventTableSchema: ClickHouseTableSchema<SimplifiedVehicleEvent>;
|
|
5
5
|
export declare const hashedShapeTableSchema: ClickHouseTableSchema<HashedShape>;
|
|
@@ -20,4 +20,4 @@ export declare const rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchem
|
|
|
20
20
|
export declare const rideAnalysisSimpleThreeVehicleEventsTableSchema: ClickHouseTableSchema<RideAnalysisSimpleThreeVehicleEvents>;
|
|
21
21
|
export declare const rideAnalysisTransactionSequentialityTableSchema: ClickHouseTableSchema<RideAnalysisTransactionSequentiality>;
|
|
22
22
|
export declare const ridesTableSchema: ClickHouseTableSchema<Ride>;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const rideMatchesTableSchema: ClickHouseTableSchema<RideMatch>;
|
|
@@ -193,18 +193,19 @@ export const ridesTableSchema = {
|
|
|
193
193
|
shape_id: { type: 'LowCardinality(String)' },
|
|
194
194
|
start_time_observed: { type: 'Nullable(Int64) CODEC(DoubleDelta, ZSTD)' },
|
|
195
195
|
start_time_scheduled: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
196
|
+
timezone: { type: 'LowCardinality(String)' },
|
|
196
197
|
trip_id: { type: 'LowCardinality(String)' },
|
|
197
198
|
updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
198
199
|
vehicle_ids: { type: 'Array(LowCardinality(String))' },
|
|
199
200
|
};
|
|
200
201
|
/* * */
|
|
201
|
-
export const
|
|
202
|
+
export const rideMatchesTableSchema = {
|
|
202
203
|
_id: { type: 'String' },
|
|
203
204
|
agency_id: { type: 'LowCardinality(String)' },
|
|
204
|
-
trip_id: { type: 'LowCardinality(String)' },
|
|
205
|
-
window_start: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
206
|
-
window_end: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
207
205
|
operational_dates: { type: 'Array(UInt32) CODEC(ZSTD)' },
|
|
208
206
|
processing_status: { type: 'LowCardinality(String)' },
|
|
207
|
+
trip_id: { type: 'LowCardinality(String)' },
|
|
209
208
|
updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
209
|
+
window_end: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
210
|
+
window_start: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
210
211
|
};
|