-
Notifications
You must be signed in to change notification settings - Fork 8
/
schema.sql
173 lines (167 loc) · 5.25 KB
/
schema.sql
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
CREATE OR REPLACE TABLE bqtail.bqjob (
ProjectID STRING,
JobType STRING,
JobID STRING,
DestinationTable STRING,
Error STRING,
TempTable STRING,
CreateTime TIMESTAMP,
StartTime TIMESTAMP,
EndTime TIMESTAMP,
ReservationName STRING,
TotalBytesProcessed INT64,
InputFileBytes INT64,
InputFiles INT64,
OutputBytes INT64,
OutputRows INT64,
BadRecords INT64,
ExecutionTimeMs INT64,
TotalSlotMs INT64,
TimeTakenMs INT64,
URI STRING,
URIs ARRAY<STRING>,
EventID STRING,
RuleURL STRING
) PARTITION BY DATE(CreateTime);
CREATE OR REPLACE TABLE bqtail.bqmon (
Timestamp TIMESTAMP,
Status STRING,
Error STRING,
UploadError STRING,
PermissionError STRING,
SchemaError STRING,
CorruptedError STRING,
Running STRUCT<
Count INT64,
Min TIMESTAMP,
Max TIMESTAMP,
Lag STRING,
LagInSec INT64
>,
Stages STRUCT<
Items ARRAY<STRUCT<
Key STRING,
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>
>
>,
Stalled STRUCT<
Items ARRAY<STRUCT<
Key STRING,
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>
>
>,
Scheduled STRUCT<
Count INT64,
Min TIMESTAMP,
Max TIMESTAMP,
Lag STRING,
LagInSec INT64
>,
InvalidSchema STRUCT<
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>,
Corrupted STRUCT<
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>,
Dest ARRAY<
STRUCT<
Table STRING,
RuleURL STRING,
Running STRUCT<
Count INT64,
Min TIMESTAMP,
Max TIMESTAMP,
Lag STRING,
LagInSec INT64
>,
Scheduled STRUCT<
Count INT64,
Min TIMESTAMP,
Max TIMESTAMP,
Lag STRING,
LagInSec INT64
>,
Done STRUCT<
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>,
Stalled STRUCT<
Items ARRAY<STRUCT<
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64,
Lag STRING,
LagInSec INT64
>
>
>,
Stages STRUCT<
Items ARRAY<STRUCT<
Key STRING,
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>
>
>,
Error STRUCT<
ProcessURL STRING,
Message STRING,
EventID INT64,
ModTime TIMESTAMP,
Destination STRING,
IsPermission BOOL,
IsSchema BOOL,
IsCorrupted BOOL
>,
InvalidSchema STRUCT<
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>,
Corrupted STRUCT<
Min TIMESTAMP,
Max TIMESTAMP,
Count INT64
>
>
>,
LongRunning ARRAY<
STRUCT<
URL STRING,
Created TIMESTAMP,
Age STRING,
Error STRING,
StalledDatafiles INT64,
ActiveDatafiles INT64
>
>
) PARTITION BY DATE(Timestamp);
CREATE OR REPLACE TABLE bqtail.bqbatch (
Resources ARRAY<STRUCT<ModTime TIMESTAMP, URL STRING>>,
`End` TIMESTAMP,
Start TIMESTAMP,
Async BOOL,
Locations ARRAY<STRING>,
URL STRING,
Region STRING,
EventID INT64,
DoneProcessURL STRING,
RuleURL STRING,
ProjectID STRING,
URIs ARRAY<STRING>,
FailedURL STRING,
ProcessURL STRING,
DestTable STRING,
Source STRUCT<Time TIMESTAMP, Status STRING, URL STRING>) PARTITION BY DATE(Start);