-
Notifications
You must be signed in to change notification settings - Fork 33
/
create_tables.cql
125 lines (113 loc) · 2.76 KB
/
create_tables.cql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
CREATE KEYSPACE IF NOT EXISTS streaming WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
CREATE TABLE IF NOT EXISTS streaming.routeInfos (
id text,
display_name text,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS streaming.vehicles (
id text,
time timestamp,
longitude double,
latitude double,
heading int,
route_id text,
run_id text,
seconds_since_report int,
PRIMARY KEY (id, time)
);
CREATE TABLE IF NOT EXISTS streaming.vehicles_flink (
id text,
time timestamp,
longitude double,
latitude double,
heading int,
route_id text,
run_id text,
seconds_since_report int,
PRIMARY KEY (id, time)
);
CREATE TABLE IF NOT EXISTS streaming.routes (
id text,
order_id int,
route_id text,
longitude double,
latitude double,
display_name text,
PRIMARY KEY (route_id, order_id, id)
) WITH CLUSTERING ORDER BY (order_id ASC);
CREATE TABLE IF NOT EXISTS streaming.vehicles_by_tileid (
tile_id text,
time_id bigint,
id text,
time timestamp,
longitude double,
latitude double,
heading int,
route_id text,
run_id text,
seconds_since_report int,
PRIMARY KEY ((tile_id, time_id), time, id)
) WITH CLUSTERING ORDER BY (time DESC);
CREATE TABLE IF NOT EXISTS streaming.vehicles_by_tileid_flink (
tile_id text,
time_id bigint,
id text,
time timestamp,
longitude double,
latitude double,
heading int,
route_id text,
run_id text,
seconds_since_report int,
PRIMARY KEY ((tile_id, time_id), time, id)
) WITH CLUSTERING ORDER BY (time DESC);
CREATE TABLE IF NOT EXISTS streaming.vehiclecluster (
id int,
time_stamp bigint,
longitude double,
latitude double,
amount int,
PRIMARY KEY (id, time_stamp)
);
CREATE TABLE IF NOT EXISTS streaming.vehiclecluster_flink (
id int,
time_stamp bigint,
longitude double,
latitude double,
amount int,
PRIMARY KEY (id, time_stamp)
);
CREATE TABLE IF NOT EXISTS streaming.vehiclecluster_by_tileid (
tile_id text,
id int,
time_stamp bigint,
longitude double,
latitude double,
amount int,
PRIMARY KEY (tile_id, id, time_stamp)
);
CREATE TABLE IF NOT EXISTS streaming.vehiclecluster_by_tileid_flink (
tile_id text,
id int,
time_stamp bigint,
longitude double,
latitude double,
amount int,
PRIMARY KEY (tile_id, id, time_stamp)
);
CREATE TABLE IF NOT EXISTS streaming.vehicleclusterdetails (
id bigint,
pos_id int,
time_stamp bigint,
longitude double,
latitude double,
PRIMARY KEY (id, pos_id, time_stamp)
);
CREATE TABLE IF NOT EXISTS streaming.vehicleclusterdetails_flink (
id bigint,
pos_id int,
time_stamp bigint,
longitude double,
latitude double,
PRIMARY KEY (id, pos_id, time_stamp)
);