我有一张类似
的Cassandra表CREATE TABLE vehicle_speed (
device_id UUID,
intersection text,
date text,
time timestamp,
vehicle_type text,
speed int,
batch_id text,
batch_status text,
PRIMARY KEY ((intersection, vehicle_type), date, time)
);
我在表格中的记录很少,如下所示
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'ABC', '2016-08-28', '2016-08-28 00:05:00+0200', 'CAR', 45, 'PROCESSED');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'ABC', '2016-08-28', '2016-08-28 00:07:02+0200', 'CAR', 46, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'XYZ', '2016-08-28', '2016-08-28 00:07:00+0200', 'CAR', 52, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'ABC', '2016-08-28', '2016-08-28 00:08:30+0200', 'CAR', 44, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'ABC', '2016-08-28', '2016-08-28 00:14:30+0200', 'CAR', 40, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'XYZ', '2016-08-28', '2016-08-28 00:09:00+0200', 'CAR', 45, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'ABC', '2016-08-28', '2016-08-28 00:08:00+0200', 'BUS', 43, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'ABC', '2016-08-28', '2016-08-28 00:07:00+0200', 'BUS', 40, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'XYZ', '2016-08-28', '2016-08-28 00:08:00+0200', 'BUS', 41, 'NEW');
INSERT INTO vehicle_speed (device_id, intersection, date, time, vehicle_type, speed, batch_status) VALUES(f81d4fae-7dec-11d0-a765-00a0c91e6bf7, 'XYZ', '2016-08-28', '2016-08-28 00:08:00+0200', 'BUS', 45, 'NEW');
我刚开始学习Scala&火花。你可以帮我用scala& amp帮助我编写以下用例的代码吗?火花?