exec-ddl
CREATE TABLE xy (x INT PRIMARY KEY, y INT)
----

exec-ddl
CREATE TABLE uv (u INT, v INT NOT NULL)
----

opt
SELECT generate_series(0,1) FROM (SELECT * FROM xy LIMIT 0)
----
project-set
 ├── columns: generate_series:5(int)
 ├── cardinality: [0 - 0]
 ├── immutable
 ├── values
 │    ├── cardinality: [0 - 0]
 │    └── key: ()
 └── zip
      └── function: generate_series [type=int, immutable]
           ├── const: 0 [type=int]
           └── const: 1 [type=int]

opt
SELECT (SELECT unnest(ARRAY[1,2,y,v]) FROM xy WHERE x = u) FROM uv
----
project
 ├── columns: unnest:11(int)
 ├── prune: (11)
 ├── ensure-distinct-on
 │    ├── columns: rowid:3(int!null) unnest:10(int)
 │    ├── grouping columns: rowid:3(int!null)
 │    ├── error: "more than one row returned by a subquery used as an expression"
 │    ├── key: (3)
 │    ├── fd: (3)-->(10)
 │    ├── prune: (10)
 │    ├── left-join-apply
 │    │    ├── columns: u:1(int) v:2(int!null) rowid:3(int!null) x:6(int) y:7(int) unnest:10(int)
 │    │    ├── fd: (3)-->(1,2)
 │    │    ├── prune: (3,10)
 │    │    ├── reject-nulls: (6,7,10)
 │    │    ├── interesting orderings: (+3)
 │    │    ├── scan uv
 │    │    │    ├── columns: u:1(int) v:2(int!null) rowid:3(int!null)
 │    │    │    ├── key: (3)
 │    │    │    ├── fd: (3)-->(1,2)
 │    │    │    ├── prune: (1-3)
 │    │    │    ├── interesting orderings: (+3)
 │    │    │    └── unfiltered-cols: (1-5)
 │    │    ├── inner-join-apply
 │    │    │    ├── columns: x:6(int!null) y:7(int) unnest:10(int)
 │    │    │    ├── outer: (1,2)
 │    │    │    ├── cardinality: [0 - 4]
 │    │    │    ├── fd: ()-->(6,7)
 │    │    │    ├── prune: (10)
 │    │    │    ├── select
 │    │    │    │    ├── columns: x:6(int!null) y:7(int)
 │    │    │    │    ├── outer: (1)
 │    │    │    │    ├── cardinality: [0 - 1]
 │    │    │    │    ├── key: ()
 │    │    │    │    ├── fd: ()-->(6,7)
 │    │    │    │    ├── prune: (7)
 │    │    │    │    ├── scan xy
 │    │    │    │    │    ├── columns: x:6(int!null) y:7(int)
 │    │    │    │    │    ├── key: (6)
 │    │    │    │    │    ├── fd: (6)-->(7)
 │    │    │    │    │    ├── prune: (6,7)
 │    │    │    │    │    └── interesting orderings: (+6)
 │    │    │    │    └── filters
 │    │    │    │         └── eq [type=bool, outer=(1,6), constraints=(/1: (/NULL - ]; /6: (/NULL - ]), fd=(1)==(6), (6)==(1)]
 │    │    │    │              ├── variable: x:6 [type=int]
 │    │    │    │              └── variable: u:1 [type=int]
 │    │    │    ├── values
 │    │    │    │    ├── columns: unnest:10(int)
 │    │    │    │    ├── outer: (2,7)
 │    │    │    │    ├── cardinality: [4 - 4]
 │    │    │    │    ├── prune: (10)
 │    │    │    │    ├── tuple [type=tuple{int}]
 │    │    │    │    │    └── const: 1 [type=int]
 │    │    │    │    ├── tuple [type=tuple{int}]
 │    │    │    │    │    └── const: 2 [type=int]
 │    │    │    │    ├── tuple [type=tuple{int}]
 │    │    │    │    │    └── variable: y:7 [type=int]
 │    │    │    │    └── tuple [type=tuple{int}]
 │    │    │    │         └── variable: v:2 [type=int]
 │    │    │    └── filters (true)
 │    │    └── filters (true)
 │    └── aggregations
 │         └── const-agg [as=unnest:10, type=int, outer=(10)]
 │              └── variable: unnest:10 [type=int]
 └── projections
      └── variable: unnest:10 [as=unnest:11, type=int, outer=(10)]
