Skip to content

Commit 179d432

Browse files
- Robot test aspirations.
1 parent 625f7ff commit 179d432

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

docs/analytics.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,66 @@ The canonical pattern is a postgres backend. To meaningfully develop analytics
88
- 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`.
99
- Connect and develop queries with `psql "postgresql://stackql:[email protected]:8632/stackql"`.
1010

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.id AS resource_id,
44+
vms.name AS resource_name,
45+
'google' AS cloud,
46+
split_part(vms.zone, '/', -1) AS region,
47+
NULL AS protocol,
48+
NULL AS from_port,
49+
NULL AS to_port,
50+
NULL AS cidr,
51+
NULL AS direction,
52+
NULL AS public_access_type,
53+
NULL AS public_principal,
54+
NULL AS access_mechanism,
55+
json_extract_path_text(ac.value, 'natIP') as external_ip
56+
FROM google.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.project in (
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.
71+
72+
---
73+

0 commit comments

Comments
 (0)