You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/24 12:54:13 UTC

[GitHub] [arrow-datafusion] alamb opened a new issue, #2606: Support `DESCRIBE `
alamb opened a new issue, #2606:
URL: https://github.com/apache/arrow-datafusion/issues/2606

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   DataFusion mostly follows postgres when it comes to compatibility. However, it also supports some usability features from mysql, notably `SHOW TABLES`;
   
   It would be nice to also get basic schema information (column names, types) about a table using `DESCRIBE <TABLE>`
   
   
   
   
   **Describe the solution you'd like**
   
   I would like to run this sequence of commands and get a nicely formatted output other than an error:
   
   ```sql
   ❯ create table foo as select * from (values (1), (3), (2), (10), (8));
   +---------+
   | column1 |
   +---------+
   | 1       |
   | 3       |
   | 2       |
   | 10      |
   | 8       |
   +---------+
   5 rows in set. Query took 0.005 seconds.
   ❯ show tables;
   +---------------+--------------------+------------+------------+
   | table_catalog | table_schema       | table_name | table_type |
   +---------------+--------------------+------------+------------+
   | datafusion    | public             | foo        | BASE TABLE |
   | datafusion    | information_schema | tables     | VIEW       |
   | datafusion    | information_schema | columns    | VIEW       |
   +---------------+--------------------+------------+------------+
   3 rows in set. Query took 0.001 seconds.
   ❯ describe foo;
   NotImplemented("Unsupported SQL statement: ExplainTable { describe_alias: true, table_name: ObjectName([Ident { value: \"foo\", quote_style: None }]) }")
   ```
   
   Here is what mysql does (the table definition is different than the example above):
   
   ```sql
   mysql> describe foo;
   +-------+---------------+------+-----+---------+-------+
   | Field | Type          | Null | Key | Default | Extra |
   +-------+---------------+------+-----+---------+-------+
   | bar   | set('a','b')  | YES  |     | NULL    |       |
   | baz   | enum('a','b') | YES  |     | NULL    |       |
   +-------+---------------+------+-----+---------+-------+
   2 rows in set (0.00 sec)
   ```
   
   Note that the information *is* accesable via information_schema so this ticket would just plumbing it all together:
   
   ```sql
   ❯ select * from information_schema.columns;
   +---------------+--------------+------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+-------------------------+---------------+--------------------+---------------+
   | table_catalog | table_schema | table_name | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | character_octet_length | numeric_precision | numeric_precision_radix | numeric_scale | datetime_precision | interval_type |
   +---------------+--------------+------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+-------------------------+---------------+--------------------+---------------+
   | datafusion    | public       | foo        | column1     | 0                |                | YES         | Int64     |                          |                        |                   |                         |               |                    |               |
   +---------------+--------------+------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+-------------------------+---------------+--------------------+---------------+
   1 row in set. Query took 0.004 seconds.
   ```
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features you've considered.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb closed issue #2606: Support `DESCRIBE

` to show table schemasPosted by GitBox <gi...@apache.org>.
alamb closed issue #2606: Support `DESCRIBE <table>` to show table schemas
URL: https://github.com/apache/arrow-datafusion/issues/2606


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] xudong963 commented on issue #2606: Support `DESCRIBE

` to show table schemasPosted by GitBox <gi...@apache.org>.
xudong963 commented on issue #2606:
URL: https://github.com/apache/arrow-datafusion/issues/2606#issuecomment-1138138101

   > Hi @alamb, can I work on this? I want to learn the implementation of datafusion by implementing this.
   
   Feel free to pick it, fighting!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] LiuYuHui commented on issue #2606: Support `DESCRIBE

` to show table schemasPosted by GitBox <gi...@apache.org>.
LiuYuHui commented on issue #2606:
URL: https://github.com/apache/arrow-datafusion/issues/2606#issuecomment-1138061517

   Hi @alamb, can I work on this? I want to learn the implementation of datafusion by implementing this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org