-
Notifications
You must be signed in to change notification settings - Fork 7
/
ddl.aql
64 lines (51 loc) · 1.38 KB
/
ddl.aql
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
//Datatypes
create type EmploymentType as {
organization: string,
start_date: date,
end_date: date?
}
create type GleambookUserType as {
id: int64,
alias: string,
name: string,
user_since: datetime,
friend_ids: {{ int64 }},
employment: [EmploymentType]
}
create type GleambookMessageType as {
message_id: int64,
author_id: int64,
in_response_to: int64?,
sender_location: point,
send_time: datetime,
message: string
}
create type ChirpUserType as {
screen_name: string,
lang: string,
friends_count: int32,
statuses_count: int32,
name: string,
followers_count: int32
}
create type ChirpMessageType as {
chirpid: int64,
user: ChirpUserType,
sender_location: point,
send_time: datetime,
referred_topics: {{ string }},
message_text: string
}
//Datasets
create dataset ChirpMessages(ChirpMessageType)
primary key chirpid;
create dataset GleambookUsers(GleambookUserType)
primary key id;
create dataset GleambookMessages(GleambookMessageType)
primary key message_id;
//Secondary Indices
create index usrSinceIx on GleambookUsers(user_since);
create index authorIdIx on GleambookMessages(author_id);
create index sndTimeIx on ChirpMessages(send_time);
create index sendLocIx on ChirpMessages(sender_location) type rtree;
create index msgNGramIdx on ChirpMessages(message_text) type ngram(2);