Skip to content

Implement information_schema.views #2857

Closed

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
#2830 added the sql to define a view into information_schema.tables

While this is useful, it isn't the standard location for such information -- the standard location is information_schema.views

For example, in mysql:

mysql> select table_catalog, table_schema, table_name, view_definition from information_schema.views where table_name = 'ff';
+---------------+--------------+------------+------------------------------------------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION                                |
+---------------+--------------+------------+------------------------------------------------+
| def           | foo          | ff         | select count(0) AS `count(*)` from `foo`.`foo` |
+---------------+--------------+------------+------------------------------------------------+
1 row in set (0.00 sec)

Describe the solution you'd like

  1. Add information_schema.views (following the model of information_schema.tables, e.g. https://github.com/apache/arrow-datafusion/blob/master/datafusion/core/src/catalog/information_schema.rs#L136-L142)
  2. Remove the non standard column definition from information_schema.tables
  3. Update SHOW CREATE TABLE to use information_schema.views

Describe alternatives you've considered
N/A

Additional context
Kudos to @mrob95 for the initial implementation.

Activity

  1. changed the title [-]Implement `information_table.views`[/-] [+]Implement `information_schema.views`[/+] on Jul 8, 2022
  2. alamb commented on Jul 8, 2022

    @alamb
    ContributorAuthor

    I think this is a good first issue because there is a model to follow (information_schema.tables) so this would be a good way to learn the existing code and tests

  3. BaymaxHWY commented on Jul 17, 2022

    @BaymaxHWY
    Contributor

    Can i try it?

  4. alamb commented on Jul 18, 2022

    @alamb
    ContributorAuthor

    Thank you @BaymaxHWY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions