-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathcreate.sql
More file actions
129 lines (128 loc) · 4.21 KB
/
Copy pathcreate.sql
File metadata and controls
129 lines (128 loc) · 4.21 KB
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
126
127
128
129
-- EventQL has a sharply narrower type set than the create.sql the rest
-- of ClickBench uses: there are no signed integers (INT32/INT64 are
-- documented but rejected by the v0.4.1 parser), no TEXT/VARCHAR/CHAR,
-- and no DATE — only UINT32, UINT64, STRING, DATETIME, DOUBLE, FLOAT,
-- and BOOL.
--
-- All hits column values are non-negative in the ClickBench dataset,
-- so SMALLINT/INTEGER/BIGINT map cleanly to UINT32/UINT64. ClientIP
-- and similar columns are stored as raw 32-bit IP values (bit pattern
-- preserved as UINT32 even when the equivalent signed-int reading
-- would be negative). TEXT/VARCHAR/CHAR collapse to STRING.
-- TIMESTAMP and DATE both become DATETIME.
--
-- Identifiers: `Title` is a reserved keyword in EventQL's SQL parser
-- (T_TITLE); backticks escape it. The remaining 104 hits column names
-- are not reserved.
--
-- PRIMARY KEY is mandatory; the first column must be one of
-- STRING/UINT64/DATETIME (it doubles as the partition key). We use
-- (EventTime, WatchID).
CREATE TABLE hits (
EventTime DATETIME NOT NULL,
WatchID UINT64 NOT NULL,
JavaEnable UINT32 NOT NULL,
`Title` STRING,
GoodEvent UINT32 NOT NULL,
EventDate DATETIME NOT NULL,
CounterID UINT32 NOT NULL,
ClientIP UINT32 NOT NULL,
RegionID UINT32 NOT NULL,
UserID UINT64 NOT NULL,
CounterClass UINT32 NOT NULL,
OS UINT32 NOT NULL,
UserAgent UINT32 NOT NULL,
URL STRING,
Referer STRING,
IsRefresh UINT32 NOT NULL,
RefererCategoryID UINT32 NOT NULL,
RefererRegionID UINT32 NOT NULL,
URLCategoryID UINT32 NOT NULL,
URLRegionID UINT32 NOT NULL,
ResolutionWidth UINT32 NOT NULL,
ResolutionHeight UINT32 NOT NULL,
ResolutionDepth UINT32 NOT NULL,
FlashMajor UINT32 NOT NULL,
FlashMinor UINT32 NOT NULL,
FlashMinor2 STRING,
NetMajor UINT32 NOT NULL,
NetMinor UINT32 NOT NULL,
UserAgentMajor UINT32 NOT NULL,
UserAgentMinor STRING,
CookieEnable UINT32 NOT NULL,
JavascriptEnable UINT32 NOT NULL,
IsMobile UINT32 NOT NULL,
MobilePhone UINT32 NOT NULL,
MobilePhoneModel STRING,
Params STRING,
IPNetworkID UINT32 NOT NULL,
TraficSourceID UINT32 NOT NULL,
SearchEngineID UINT32 NOT NULL,
SearchPhrase STRING,
AdvEngineID UINT32 NOT NULL,
IsArtifical UINT32 NOT NULL,
WindowClientWidth UINT32 NOT NULL,
WindowClientHeight UINT32 NOT NULL,
ClientTimeZone UINT32 NOT NULL,
ClientEventTime DATETIME NOT NULL,
SilverlightVersion1 UINT32 NOT NULL,
SilverlightVersion2 UINT32 NOT NULL,
SilverlightVersion3 UINT32 NOT NULL,
SilverlightVersion4 UINT32 NOT NULL,
PageCharset STRING,
CodeVersion UINT32 NOT NULL,
IsLink UINT32 NOT NULL,
IsDownload UINT32 NOT NULL,
IsNotBounce UINT32 NOT NULL,
FUniqID UINT64 NOT NULL,
OriginalURL STRING,
HID UINT32 NOT NULL,
IsOldCounter UINT32 NOT NULL,
IsEvent UINT32 NOT NULL,
IsParameter UINT32 NOT NULL,
DontCountHits UINT32 NOT NULL,
WithHash UINT32 NOT NULL,
HitColor STRING NOT NULL,
LocalEventTime DATETIME NOT NULL,
Age UINT32 NOT NULL,
Sex UINT32 NOT NULL,
Income UINT32 NOT NULL,
Interests UINT32 NOT NULL,
Robotness UINT32 NOT NULL,
RemoteIP UINT32 NOT NULL,
WindowName UINT32 NOT NULL,
OpenerName UINT32 NOT NULL,
HistoryLength UINT32 NOT NULL,
BrowserLanguage STRING,
BrowserCountry STRING,
SocialNetwork STRING,
SocialAction STRING,
HTTPError UINT32 NOT NULL,
SendTiming UINT32 NOT NULL,
DNSTiming UINT32 NOT NULL,
ConnectTiming UINT32 NOT NULL,
ResponseStartTiming UINT32 NOT NULL,
ResponseEndTiming UINT32 NOT NULL,
FetchTiming UINT32 NOT NULL,
SocialSourceNetworkID UINT32 NOT NULL,
SocialSourcePage STRING,
ParamPrice UINT64 NOT NULL,
ParamOrderID STRING,
ParamCurrency STRING,
ParamCurrencyID UINT32 NOT NULL,
OpenstatServiceName STRING,
OpenstatCampaignID STRING,
OpenstatAdID STRING,
OpenstatSourceID STRING,
UTMSource STRING,
UTMMedium STRING,
UTMCampaign STRING,
UTMContent STRING,
UTMTerm STRING,
FromTag STRING,
HasGCLID UINT32 NOT NULL,
RefererHash UINT64 NOT NULL,
URLHash UINT64 NOT NULL,
CLID UINT32 NOT NULL,
PRIMARY KEY (EventTime, WatchID)
);