exec-ddl
CREATE TABLE xy (x INT PRIMARY KEY, y INT)
----
TABLE xy
 ├── x int not null
 ├── y int
 └── INDEX primary
      └── x int not null

build
EXPLAIN SELECT * FROM xy
----
explain
 ├── columns: tree:3(string) field:4(string) description:5(string)
 └── scan xy
      └── columns: x:1(int!null) y:2(int)

build
EXPLAIN (PLAN,SYMVARS) SELECT * FROM xy
----
explain
 ├── columns: tree:3(string) field:4(string) description:5(string)
 └── scan xy
      └── columns: x:1(int!null) y:2(int)

build
EXPLAIN (TYPES) SELECT * FROM xy
----
explain
 ├── columns: tree:3(string) field:6(string) description:7(string) columns:8(string) ordering:9(string)  [hidden: level:4(int) node_type:5(string)]
 └── scan xy
      └── columns: x:1(int!null) y:2(int)

build
EXPLAIN (VERBOSE) SELECT * FROM xy
----
explain
 ├── columns: tree:3(string) field:6(string) description:7(string) columns:8(string) ordering:9(string)  [hidden: level:4(int) node_type:5(string)]
 ├── mode: verbose
 └── scan xy
      └── columns: x:1(int!null) y:2(int)

# Verify we preserve the ordering requirement of the explained query.
build
EXPLAIN (VERBOSE) SELECT * FROM xy ORDER BY y
----
explain
 ├── columns: tree:3(string) field:6(string) description:7(string) columns:8(string) ordering:9(string)  [hidden: level:4(int) node_type:5(string)]
 ├── mode: verbose
 └── sort
      ├── columns: x:1(int!null) y:2(int)
      ├── ordering: +2
      └── scan xy
           └── columns: x:1(int!null) y:2(int)

build
EXPLAIN (VERBOSE) SELECT * FROM xy INNER JOIN (VALUES (1, 2), (3, 4)) AS t(u,v) ON x=u
----
explain
 ├── columns: tree:5(string) field:8(string) description:9(string) columns:10(string) ordering:11(string)  [hidden: level:6(int) node_type:7(string)]
 ├── mode: verbose
 └── inner-join
      ├── columns: x:1(int!null) y:2(int) u:3(int!null) v:4(int)
      ├── scan xy
      │    └── columns: x:1(int!null) y:2(int)
      ├── values
      │    ├── columns: column1:3(int) column2:4(int)
      │    ├── tuple [type=tuple{int, int}]
      │    │    ├── const: 1 [type=int]
      │    │    └── const: 2 [type=int]
      │    └── tuple [type=tuple{int, int}]
      │         ├── const: 3 [type=int]
      │         └── const: 4 [type=int]
      └── filters
           └── eq [type=bool]
                ├── variable: x [type=int]
                └── variable: column1 [type=int]

build
SELECT tree FROM [ EXPLAIN (VERBOSE) SELECT * FROM xy ]
----
project
 ├── columns: tree:3(string)
 └── explain
      ├── columns: tree:3(string) level:4(int) node_type:5(string) field:6(string) description:7(string) columns:8(string) ordering:9(string)
      ├── mode: verbose
      └── scan xy
           └── columns: x:1(int!null) y:2(int)

build
SELECT tree FROM [ EXPLAIN (VERBOSE) SELECT x, x, y FROM xy ORDER BY y ]
----
project
 ├── columns: tree:3(string)
 └── explain
      ├── columns: tree:3(string) level:4(int) node_type:5(string) field:6(string) description:7(string) columns:8(string) ordering:9(string)
      ├── mode: verbose
      └── sort
           ├── columns: x:1(int!null) x:1(int!null) y:2(int)
           ├── ordering: +2
           └── scan xy
                └── columns: x:1(int!null) y:2(int)
