apache / apache/datafusion

Create DDL Command `DESCRIBE/EXPLAIN/SHOW`

Open
#17,466 3 comments 0 reactions 1 assignee Claimed by @comphead View on GitHub
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

The idea is to output the schema for query similar to DuckDB or Apache Spark

```
D describe select map_extract(map([1], ['a']), 1)[1];
┌────────────────────────────────────────────────────────────────────┬─────────────┬─────────┬─────────┬─────────┬─────────┐
│ column_name │ column_type │ null │ key │ default │ extra │
│ varchar │ varchar │ varchar │ varchar │ varchar │ varchar │
├────────────────────────────────────────────────────────────────────┼─────────────┼─────────┼─────────┼─────────┼─────────┤
│ map_extract("map"(main.list_value(1), main.list_value('a')), 1)[1] │ VARCHAR │ YES │ │ │ │
└────────────────────────────────────────────────────────────────────┴─────────────┴─────────┴─────────┴─────────┴─────────┘
D
```

it would require some discussion what command to use? Some possible options below

### Possible DDL options

`DESCRIBE query` - like in DuckDB
`EXPLAIN SCHEMA query`
`SHOW SCHEMA query`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.