You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/analytics.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,3 +8,66 @@ The canonical pattern is a postgres backend. To meaningfully develop analytics
8
8
- Run and kill development containers with `docker compose -f docker-compose-live.yml down --volumes` / `docker compose -f docker-compose-live.yml up --force-recreate`.
9
9
- Connect and develop queries with `psql "postgresql://stackql:[email protected]:8632/stackql"`.
10
10
11
+
12
+
## TODO
13
+
14
+
Robot tests for:
15
+
16
+
- Support for `current_date`.
17
+
- Support for `current_timestamp`.
18
+
- Support for multi-layered table valued functions in subqueries with outside filters, per Figure MLS-01.
19
+
20
+
---
21
+
22
+
```sql
23
+
24
+
CREATE OR REPLACE MATERIALIZED VIEW gcp_compute_public_ip_exposure AS
25
+
select
26
+
resource_type,
27
+
resource_id,
28
+
resource_name,
29
+
cloud,
30
+
region,
31
+
protocol,
32
+
from_port,
33
+
to_port,
34
+
cidr,
35
+
direction,
36
+
public_access_type,
37
+
public_principal,
38
+
access_mechanism
39
+
from
40
+
(
41
+
SELECT
42
+
'compute'AS resource_type,
43
+
vms.idAS resource_id,
44
+
vms.nameAS resource_name,
45
+
'google'AS cloud,
46
+
split_part(vms.zone, '/', -1) AS region,
47
+
NULLAS protocol,
48
+
NULLAS from_port,
49
+
NULLAS to_port,
50
+
NULLAScidr,
51
+
NULLAS direction,
52
+
NULLAS public_access_type,
53
+
NULLAS public_principal,
54
+
NULLAS access_mechanism,
55
+
json_extract_path_text(ac.value, 'natIP') as external_ip
56
+
FROMgoogle.compute.instances vms,
57
+
json_array_elements_text(vms.networkInterfaces) AS ni,
58
+
json_array_elements_text(json_extract_path_text(ni.value, 'accessConfigs')) AS ac
59
+
WHERE
60
+
vms.projectin (
61
+
'stackql-demo',
62
+
'stackql-robot'
63
+
)
64
+
) foo
65
+
where external_ip !=''
66
+
;
67
+
68
+
```
69
+
70
+
**Figure MLS-01**: Multi-layered table valued functions in subqueries with outside filters.
0 commit comments