@hypequery/protocol-conformance 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ [
2
+ {
3
+ "id": "derived-measures",
4
+ "value": {
5
+ "kind": "hypequery-deployment",
6
+ "version": 2,
7
+ "datasets": [
8
+ {
9
+ "name": "orders",
10
+ "source": "orders",
11
+ "tenant": {
12
+ "kind": "not-required"
13
+ },
14
+ "dimensions": [],
15
+ "measures": [
16
+ {
17
+ "name": "revenue",
18
+ "aggregation": "sum",
19
+ "field": "amount",
20
+ "filters": []
21
+ },
22
+ {
23
+ "name": "orders",
24
+ "aggregation": "count",
25
+ "field": "id",
26
+ "filters": []
27
+ },
28
+ {
29
+ "kind": "derived",
30
+ "name": "averageOrderValue",
31
+ "uses": [
32
+ {
33
+ "alias": "revenue",
34
+ "measure": "revenue"
35
+ },
36
+ {
37
+ "alias": "orders",
38
+ "measure": "orders"
39
+ }
40
+ ],
41
+ "expression": {
42
+ "kind": "binary",
43
+ "operator": "divide",
44
+ "left": {
45
+ "kind": "reference",
46
+ "name": "revenue"
47
+ },
48
+ "right": {
49
+ "kind": "call",
50
+ "function": "nullIfZero",
51
+ "args": [
52
+ {
53
+ "kind": "reference",
54
+ "name": "orders"
55
+ }
56
+ ]
57
+ }
58
+ }
59
+ }
60
+ ],
61
+ "filters": [],
62
+ "relationships": []
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ ]
@@ -1,7 +1,7 @@
1
1
  [
2
- { "id": "empty-object", "value": {}, "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1", "query-implementations-v1", "deployments-v1"] },
2
+ { "id": "empty-object", "value": {}, "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1", "query-implementations-v1", "deployments-v2"] },
3
3
  { "id": "null-root", "value": null, "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1"] },
4
- { "id": "array-root", "value": [], "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1", "deployments-v1"] },
4
+ { "id": "array-root", "value": [], "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1", "deployments-v2"] },
5
5
  { "id": "string-root", "value": "hello", "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1"] },
6
6
  { "id": "number-root", "value": 42, "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1"] },
7
7
  { "id": "unknown-kind", "value": { "kind": "no-such-kind" }, "targets": ["expressions-v1", "query-schemas-v1", "query-implementations-v1"] },
@@ -25,7 +25,7 @@
25
25
  { "id": "unicode-identifier-confusable", "value": { "kind": "reference", "name": "аdmin" }, "targets": ["expressions-v1"] },
26
26
  { "id": "event-kind-only", "value": { "kind": "hypequery-query-event" }, "targets": ["query-events-v1"] },
27
27
  { "id": "diagnostics-kind-only", "value": { "kind": "hypequery-query-diagnostics" }, "targets": ["query-diagnostics-v1"] },
28
- { "id": "deployment-kind-only", "value": { "kind": "hypequery-deployment" }, "targets": ["deployments-v1"] },
28
+ { "id": "deployment-kind-only", "value": { "kind": "hypequery-deployment" }, "targets": ["deployments-v2"] },
29
29
  { "id": "implementation-kind-only", "value": { "kind": "compiled-sql" }, "targets": ["query-implementations-v1"] },
30
30
  { "id": "negative-version", "value": { "kind": "hypequery-query-event", "version": -1 }, "targets": ["query-events-v1"] },
31
31
  { "id": "float-version", "value": { "kind": "hypequery-query-event", "version": 1.5 }, "targets": ["query-events-v1"] }
@@ -92,22 +92,22 @@
92
92
  ]
93
93
  },
94
94
  {
95
- "name": "deployments-v1",
95
+ "name": "deployments-v2",
96
96
  "rfc": "0006",
97
97
  "codePrefixes": [
98
98
  "HQ_DEPLOYMENT_"
99
99
  ],
100
100
  "files": [
101
101
  {
102
- "path": "deployments-v1/success.json",
102
+ "path": "deployments-v2/success.json",
103
103
  "role": "success"
104
104
  },
105
105
  {
106
- "path": "deployments-v1/rejections.json",
106
+ "path": "deployments-v2/rejections.json",
107
107
  "role": "rejection"
108
108
  },
109
109
  {
110
- "path": "deployments-v1/identity.json",
110
+ "path": "deployments-v2/identity.json",
111
111
  "role": "identity"
112
112
  }
113
113
  ]
@@ -20,7 +20,9 @@
20
20
  {
21
21
  "id": "implementation-unknown-kind",
22
22
  "surface": "query-implementation",
23
- "value": { "kind": "raw-sql" },
23
+ "value": {
24
+ "kind": "raw-sql"
25
+ },
24
26
  "error": "HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND"
25
27
  },
26
28
  {
@@ -54,27 +56,464 @@
54
56
  "operation": "select",
55
57
  "statement": "SELECT * FROM trips WHERE tenant_id = {tenantId:UUID}",
56
58
  "parameters": [],
57
- "readSources": ["trips"],
58
- "tenant": { "kind": "required", "parameter": "tenantId" }
59
+ "readSources": [
60
+ "trips"
61
+ ],
62
+ "tenant": {
63
+ "kind": "required",
64
+ "parameter": "tenantId"
65
+ }
59
66
  },
60
67
  "error": "HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE"
61
68
  },
62
69
  {
63
70
  "id": "compiled-sql-too-many-parameters",
64
71
  "surface": "query-implementation",
65
- "generator": { "type": "parameters", "count": 101 },
72
+ "generator": {
73
+ "type": "parameters",
74
+ "count": 101
75
+ },
66
76
  "error": "HQ_QUERY_IMPLEMENTATION_TOO_MANY_ITEMS"
67
77
  },
68
78
  {
69
79
  "id": "sql-expression-too-large",
70
80
  "surface": "sql-expression",
71
- "generator": { "type": "sql-expression", "bytes": 65537 },
81
+ "generator": {
82
+ "type": "sql-expression",
83
+ "bytes": 65537
84
+ },
72
85
  "error": "HQ_QUERY_IMPLEMENTATION_TOO_LARGE"
73
86
  },
74
87
  {
75
88
  "id": "implementation-accessor",
76
89
  "surface": "query-implementation",
77
- "generator": { "type": "unsafe-accessor" },
90
+ "generator": {
91
+ "type": "unsafe-accessor"
92
+ },
78
93
  "error": "HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT"
94
+ },
95
+ {
96
+ "id": "implementation-missing-field",
97
+ "surface": "query-implementation",
98
+ "value": {
99
+ "kind": "compiled-sql",
100
+ "dialect": "clickhouse",
101
+ "operation": "select",
102
+ "parameters": [],
103
+ "readSources": [],
104
+ "tenant": {
105
+ "kind": "not-required"
106
+ }
107
+ },
108
+ "error": "HQ_QUERY_IMPLEMENTATION_TYPE"
109
+ },
110
+ {
111
+ "id": "implementation-unknown-field-precedes-invalid-value",
112
+ "surface": "query-implementation",
113
+ "value": {
114
+ "kind": "compiled-sql",
115
+ "dialect": "clickhouse",
116
+ "operation": "insert",
117
+ "statement": "SELECT 1",
118
+ "parameters": [],
119
+ "readSources": [],
120
+ "tenant": {
121
+ "kind": "not-required"
122
+ },
123
+ "bogus": 1
124
+ },
125
+ "error": "HQ_QUERY_IMPLEMENTATION_UNKNOWN_FIELD"
126
+ },
127
+ {
128
+ "id": "implementation-non-string-kind",
129
+ "surface": "query-implementation",
130
+ "value": {
131
+ "kind": 1
132
+ },
133
+ "error": "HQ_QUERY_IMPLEMENTATION_TYPE"
134
+ },
135
+ {
136
+ "id": "implementation-sql-expression-is-not-in-the-union",
137
+ "surface": "query-implementation",
138
+ "value": {
139
+ "kind": "sql-expression"
140
+ },
141
+ "error": "HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND"
142
+ },
143
+ {
144
+ "id": "compiled-sql-invalid-operation",
145
+ "surface": "query-implementation",
146
+ "value": {
147
+ "kind": "compiled-sql",
148
+ "dialect": "clickhouse",
149
+ "operation": "insert",
150
+ "statement": "SELECT 1",
151
+ "parameters": [],
152
+ "readSources": [],
153
+ "tenant": {
154
+ "kind": "not-required"
155
+ }
156
+ },
157
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
158
+ },
159
+ {
160
+ "id": "compiled-sql-invalid-dialect",
161
+ "surface": "query-implementation",
162
+ "value": {
163
+ "kind": "compiled-sql",
164
+ "dialect": "postgres",
165
+ "operation": "select",
166
+ "statement": "SELECT 1",
167
+ "parameters": [],
168
+ "readSources": [],
169
+ "tenant": {
170
+ "kind": "not-required"
171
+ }
172
+ },
173
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
174
+ },
175
+ {
176
+ "id": "compiled-sql-blank-statement",
177
+ "surface": "query-implementation",
178
+ "value": {
179
+ "kind": "compiled-sql",
180
+ "dialect": "clickhouse",
181
+ "operation": "select",
182
+ "statement": " ",
183
+ "parameters": [],
184
+ "readSources": [],
185
+ "tenant": {
186
+ "kind": "not-required"
187
+ }
188
+ },
189
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
190
+ },
191
+ {
192
+ "id": "compiled-sql-byte-order-mark-statement",
193
+ "surface": "query-implementation",
194
+ "value": {
195
+ "kind": "compiled-sql",
196
+ "dialect": "clickhouse",
197
+ "operation": "select",
198
+ "statement": "",
199
+ "parameters": [],
200
+ "readSources": [],
201
+ "tenant": {
202
+ "kind": "not-required"
203
+ }
204
+ },
205
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
206
+ },
207
+ {
208
+ "id": "compiled-sql-control-in-clickhouse-type",
209
+ "surface": "query-implementation",
210
+ "value": {
211
+ "kind": "compiled-sql",
212
+ "dialect": "clickhouse",
213
+ "operation": "select",
214
+ "statement": "SELECT 1",
215
+ "parameters": [
216
+ {
217
+ "name": "a",
218
+ "source": {
219
+ "kind": "input",
220
+ "path": "a"
221
+ },
222
+ "clickHouseType": "Str\ting"
223
+ }
224
+ ],
225
+ "readSources": [],
226
+ "tenant": {
227
+ "kind": "not-required"
228
+ }
229
+ },
230
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
231
+ },
232
+ {
233
+ "id": "compiled-sql-control-in-read-source",
234
+ "surface": "query-implementation",
235
+ "value": {
236
+ "kind": "compiled-sql",
237
+ "dialect": "clickhouse",
238
+ "operation": "select",
239
+ "statement": "SELECT 1",
240
+ "parameters": [],
241
+ "readSources": [
242
+ "analytics\ttrips"
243
+ ],
244
+ "tenant": {
245
+ "kind": "not-required"
246
+ }
247
+ },
248
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
249
+ },
250
+ {
251
+ "id": "compiled-sql-duplicate-read-sources",
252
+ "surface": "query-implementation",
253
+ "value": {
254
+ "kind": "compiled-sql",
255
+ "dialect": "clickhouse",
256
+ "operation": "select",
257
+ "statement": "SELECT 1",
258
+ "parameters": [],
259
+ "readSources": [
260
+ "analytics.trips",
261
+ "analytics.trips"
262
+ ],
263
+ "tenant": {
264
+ "kind": "not-required"
265
+ }
266
+ },
267
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
268
+ },
269
+ {
270
+ "id": "compiled-sql-duplicate-parameter-names",
271
+ "surface": "query-implementation",
272
+ "value": {
273
+ "kind": "compiled-sql",
274
+ "dialect": "clickhouse",
275
+ "operation": "select",
276
+ "statement": "SELECT 1",
277
+ "parameters": [
278
+ {
279
+ "name": "a",
280
+ "source": {
281
+ "kind": "input",
282
+ "path": "a"
283
+ },
284
+ "clickHouseType": "String"
285
+ },
286
+ {
287
+ "name": "a",
288
+ "source": {
289
+ "kind": "input",
290
+ "path": "a"
291
+ },
292
+ "clickHouseType": "String"
293
+ }
294
+ ],
295
+ "readSources": [],
296
+ "tenant": {
297
+ "kind": "not-required"
298
+ }
299
+ },
300
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE"
301
+ },
302
+ {
303
+ "id": "compiled-sql-not-required-with-tenant-parameter",
304
+ "surface": "query-implementation",
305
+ "value": {
306
+ "kind": "compiled-sql",
307
+ "dialect": "clickhouse",
308
+ "operation": "select",
309
+ "statement": "SELECT 1",
310
+ "parameters": [
311
+ {
312
+ "name": "a",
313
+ "source": {
314
+ "kind": "tenant"
315
+ },
316
+ "clickHouseType": "String"
317
+ }
318
+ ],
319
+ "readSources": [],
320
+ "tenant": {
321
+ "kind": "not-required"
322
+ }
323
+ },
324
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE"
325
+ },
326
+ {
327
+ "id": "compiled-sql-two-tenant-parameters",
328
+ "surface": "query-implementation",
329
+ "value": {
330
+ "kind": "compiled-sql",
331
+ "dialect": "clickhouse",
332
+ "operation": "select",
333
+ "statement": "SELECT 1",
334
+ "parameters": [
335
+ {
336
+ "name": "a",
337
+ "source": {
338
+ "kind": "tenant"
339
+ },
340
+ "clickHouseType": "String"
341
+ },
342
+ {
343
+ "name": "b",
344
+ "source": {
345
+ "kind": "tenant"
346
+ },
347
+ "clickHouseType": "String"
348
+ }
349
+ ],
350
+ "readSources": [],
351
+ "tenant": {
352
+ "kind": "required",
353
+ "parameter": "a"
354
+ }
355
+ },
356
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE"
357
+ },
358
+ {
359
+ "id": "compiled-sql-required-tenant-names-an-input-parameter",
360
+ "surface": "query-implementation",
361
+ "value": {
362
+ "kind": "compiled-sql",
363
+ "dialect": "clickhouse",
364
+ "operation": "select",
365
+ "statement": "SELECT 1",
366
+ "parameters": [
367
+ {
368
+ "name": "a",
369
+ "source": {
370
+ "kind": "input",
371
+ "path": "a"
372
+ },
373
+ "clickHouseType": "String"
374
+ }
375
+ ],
376
+ "readSources": [],
377
+ "tenant": {
378
+ "kind": "required",
379
+ "parameter": "a"
380
+ }
381
+ },
382
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE"
383
+ },
384
+ {
385
+ "id": "parameter-source-non-string-kind",
386
+ "surface": "query-implementation",
387
+ "value": {
388
+ "kind": "compiled-sql",
389
+ "dialect": "clickhouse",
390
+ "operation": "select",
391
+ "statement": "SELECT 1",
392
+ "parameters": [
393
+ {
394
+ "name": "a",
395
+ "source": {
396
+ "kind": 1
397
+ },
398
+ "clickHouseType": "String"
399
+ }
400
+ ],
401
+ "readSources": [],
402
+ "tenant": {
403
+ "kind": "not-required"
404
+ }
405
+ },
406
+ "error": "HQ_QUERY_IMPLEMENTATION_TYPE"
407
+ },
408
+ {
409
+ "id": "parameter-source-unknown-kind",
410
+ "surface": "query-implementation",
411
+ "value": {
412
+ "kind": "compiled-sql",
413
+ "dialect": "clickhouse",
414
+ "operation": "select",
415
+ "statement": "SELECT 1",
416
+ "parameters": [
417
+ {
418
+ "name": "a",
419
+ "source": {
420
+ "kind": "environment"
421
+ },
422
+ "clickHouseType": "String"
423
+ }
424
+ ],
425
+ "readSources": [],
426
+ "tenant": {
427
+ "kind": "not-required"
428
+ }
429
+ },
430
+ "error": "HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND"
431
+ },
432
+ {
433
+ "id": "semantic-plan-invalid-query",
434
+ "surface": "query-implementation",
435
+ "value": {
436
+ "kind": "semantic-plan",
437
+ "query": {
438
+ "kind": "nope"
439
+ }
440
+ },
441
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
442
+ },
443
+ {
444
+ "id": "runtime-invalid-runtime",
445
+ "surface": "query-implementation",
446
+ "value": {
447
+ "kind": "runtime-reference",
448
+ "runtime": "deno",
449
+ "artifactSha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
450
+ "entrypoint": "queries.run"
451
+ },
452
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
453
+ },
454
+ {
455
+ "id": "sql-expression-blank",
456
+ "surface": "sql-expression",
457
+ "value": {
458
+ "kind": "sql-expression",
459
+ "dialect": "clickhouse",
460
+ "sql": " ",
461
+ "output": {
462
+ "kind": "string"
463
+ },
464
+ "dependencies": [
465
+ "x"
466
+ ]
467
+ },
468
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
469
+ },
470
+ {
471
+ "id": "sql-expression-byte-order-mark",
472
+ "surface": "sql-expression",
473
+ "value": {
474
+ "kind": "sql-expression",
475
+ "dialect": "clickhouse",
476
+ "sql": "",
477
+ "output": {
478
+ "kind": "string"
479
+ },
480
+ "dependencies": [
481
+ "x"
482
+ ]
483
+ },
484
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
485
+ },
486
+ {
487
+ "id": "sql-expression-duplicate-dependencies",
488
+ "surface": "sql-expression",
489
+ "value": {
490
+ "kind": "sql-expression",
491
+ "dialect": "clickhouse",
492
+ "sql": "toDate(x)",
493
+ "output": {
494
+ "kind": "string"
495
+ },
496
+ "dependencies": [
497
+ "x",
498
+ "x"
499
+ ]
500
+ },
501
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
502
+ },
503
+ {
504
+ "id": "sql-expression-invalid-dependency",
505
+ "surface": "sql-expression",
506
+ "value": {
507
+ "kind": "sql-expression",
508
+ "dialect": "clickhouse",
509
+ "sql": "toDate(x)",
510
+ "output": {
511
+ "kind": "string"
512
+ },
513
+ "dependencies": [
514
+ "a/b"
515
+ ]
516
+ },
517
+ "error": "HQ_QUERY_IMPLEMENTATION_INVALID_IDENTIFIER"
79
518
  }
80
519
  ]