@tmlmobilidade/go-interfaces-labdb 20260908.220.27 → 20260908.1705.39
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,7 +1,6 @@
|
|
|
1
1
|
import { ClickHouseInterfaceTemplate } from '../interface.template.js';
|
|
2
2
|
import { ClickHouseClient } from '@tmlmobilidade/go-clients-clickhouse';
|
|
3
|
-
import { type HashedShape, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventCoverageGeo, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality, type
|
|
4
|
-
import { type Ride } from '@tmlmobilidade/go-types-operation';
|
|
3
|
+
import { type HashedShape, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventCoverageGeo, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality, type SimplifiedRide } from '@tmlmobilidade/go-types-operation';
|
|
5
4
|
import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
|
|
6
5
|
export declare class OperationDatabase {
|
|
7
6
|
readonly hashedShapes: ClickHouseInterfaceTemplate<HashedShape>;
|
|
@@ -22,8 +21,7 @@ export declare class OperationDatabase {
|
|
|
22
21
|
readonly rideAnalysisSimpleOneVehicleEventOrApexValidation: ClickHouseInterfaceTemplate<RideAnalysisSimpleOneVehicleEventOrApexValidation>;
|
|
23
22
|
readonly rideAnalysisSimpleThreeVehicleEvents: ClickHouseInterfaceTemplate<RideAnalysisSimpleThreeVehicleEvents>;
|
|
24
23
|
readonly rideAnalysisTransactionSequentiality: ClickHouseInterfaceTemplate<RideAnalysisTransactionSequentiality>;
|
|
25
|
-
readonly
|
|
26
|
-
readonly rides: ClickHouseInterfaceTemplate<Ride>;
|
|
24
|
+
readonly simplifiedRides: ClickHouseInterfaceTemplate<SimplifiedRide>;
|
|
27
25
|
readonly simplifiedVehicleEvents: ClickHouseInterfaceTemplate<SimplifiedVehicleEvent>;
|
|
28
26
|
private readonly databaseName;
|
|
29
27
|
constructor(instance: ClickHouseClient);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { ClickHouseInterfaceTemplate } from '../interface.template.js';
|
|
3
|
-
import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventCoverageGeoTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema,
|
|
3
|
+
import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventCoverageGeoTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema, simplifiedRidesTableSchema, simplifiedVehicleEventTableSchema } from '../schemas/operation.js';
|
|
4
4
|
/* * */
|
|
5
5
|
export class OperationDatabase {
|
|
6
6
|
//
|
|
@@ -22,8 +22,7 @@ export class OperationDatabase {
|
|
|
22
22
|
rideAnalysisSimpleOneVehicleEventOrApexValidation;
|
|
23
23
|
rideAnalysisSimpleThreeVehicleEvents;
|
|
24
24
|
rideAnalysisTransactionSequentiality;
|
|
25
|
-
|
|
26
|
-
rides;
|
|
25
|
+
simplifiedRides;
|
|
27
26
|
simplifiedVehicleEvents;
|
|
28
27
|
databaseName = 'operation';
|
|
29
28
|
constructor(instance) {
|
|
@@ -117,11 +116,7 @@ export class OperationDatabase {
|
|
|
117
116
|
orderBy: ['ride_id'],
|
|
118
117
|
partitionBy: 'intDiv(operational_date, 100)',
|
|
119
118
|
});
|
|
120
|
-
this.
|
|
121
|
-
engine: 'ReplacingMergeTree(updated_at)',
|
|
122
|
-
orderBy: ['agency_id', 'trip_id', 'window_start', 'window_end'],
|
|
123
|
-
});
|
|
124
|
-
this.rides = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'rides', ridesTableSchema, {
|
|
119
|
+
this.simplifiedRides = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'simplified_rides', simplifiedRidesTableSchema, {
|
|
125
120
|
engine: 'ReplacingMergeTree(updated_at)',
|
|
126
121
|
orderBy: ['agency_id', 'operational_date', 'route_short_name', 'shape_id', 'start_time_scheduled', '_id'],
|
|
127
122
|
partitionBy: 'intDiv(operational_date, 100)',
|
|
@@ -150,8 +145,7 @@ export class OperationDatabase {
|
|
|
150
145
|
await this.rideAnalysisSimpleOneVehicleEventOrApexValidation.init();
|
|
151
146
|
await this.rideAnalysisSimpleThreeVehicleEvents.init();
|
|
152
147
|
await this.rideAnalysisTransactionSequentiality.init();
|
|
153
|
-
await this.
|
|
154
|
-
await this.rides.init();
|
|
148
|
+
await this.simplifiedRides.init();
|
|
155
149
|
await this.simplifiedVehicleEvents.init();
|
|
156
150
|
}
|
|
157
151
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ClickHouseTableSchema } from '@tmlmobilidade/go-clients-clickhouse';
|
|
2
|
-
import { type HashedShape, type HashedTrip, type
|
|
2
|
+
import { type HashedShape, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventCoverageGeo, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality, type SimplifiedRide } from '@tmlmobilidade/go-types-operation';
|
|
3
3
|
import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
|
|
4
4
|
export declare const hashedShapeTableSchema: ClickHouseTableSchema<HashedShape>;
|
|
5
5
|
export declare const hashedTripTableSchema: ClickHouseTableSchema<HashedTrip>;
|
|
@@ -19,6 +19,5 @@ export declare const rideAnalysisSimpleOneApexValidationTableSchema: ClickHouseT
|
|
|
19
19
|
export declare const rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema: ClickHouseTableSchema<RideAnalysisSimpleOneVehicleEventOrApexValidation>;
|
|
20
20
|
export declare const rideAnalysisSimpleThreeVehicleEventsTableSchema: ClickHouseTableSchema<RideAnalysisSimpleThreeVehicleEvents>;
|
|
21
21
|
export declare const rideAnalysisTransactionSequentialityTableSchema: ClickHouseTableSchema<RideAnalysisTransactionSequentiality>;
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const ridesTableSchema: ClickHouseTableSchema<Ride>;
|
|
22
|
+
export declare const simplifiedRidesTableSchema: ClickHouseTableSchema<SimplifiedRide>;
|
|
24
23
|
export declare const simplifiedVehicleEventTableSchema: ClickHouseTableSchema<SimplifiedVehicleEvent>;
|
|
@@ -136,18 +136,7 @@ export const rideAnalysisTransactionSequentialityTableSchema = {
|
|
|
136
136
|
missing_transactions_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
|
|
137
137
|
};
|
|
138
138
|
/* * */
|
|
139
|
-
export const
|
|
140
|
-
_id: { type: 'String' },
|
|
141
|
-
agency_id: { type: 'LowCardinality(String)' },
|
|
142
|
-
operational_dates: { type: 'Array(UInt32) CODEC(ZSTD)' },
|
|
143
|
-
processing_status: { type: 'LowCardinality(String)' },
|
|
144
|
-
trip_id: { type: 'LowCardinality(String)' },
|
|
145
|
-
updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
146
|
-
window_end: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
147
|
-
window_start: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
148
|
-
};
|
|
149
|
-
/* * */
|
|
150
|
-
export const ridesTableSchema = {
|
|
139
|
+
export const simplifiedRidesTableSchema = {
|
|
151
140
|
_id: { type: 'String' },
|
|
152
141
|
agency_code: { type: 'LowCardinality(String)' },
|
|
153
142
|
agency_id: { type: 'LowCardinality(String)' },
|
|
@@ -165,6 +154,7 @@ export const ridesTableSchema = {
|
|
|
165
154
|
end_time_scheduled: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
|
|
166
155
|
extension_observed: { type: 'Nullable(UInt32) CODEC(T64, ZSTD)' },
|
|
167
156
|
extension_scheduled: { type: 'UInt32 CODEC(T64, ZSTD)' },
|
|
157
|
+
hash: { type: 'String' },
|
|
168
158
|
hashed_shape_id: { type: 'LowCardinality(String)' },
|
|
169
159
|
hashed_trip_id: { type: 'LowCardinality(String)' },
|
|
170
160
|
headsign: { type: 'LowCardinality(String)' },
|