Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-5543: Implement SHOW TABLES/SCHEMAS sql commands - #1278
Conversation
This patch adds new SQL grammar like following - SHOW SCHEMAS [like '<pattern>'] - SHOW TABLES [IN <schema>] [like '<pattern'] Example invocations: - show schemas - show scemas like 'SYS%' - show tables - show tables in SYSTEM - show tables in SYSTEM like 'CAT%' The current way of fetching this information is by using !tables and !schemas via sqlline JDBC support but that is not flexible enough for the end users to add more fitlers. This approach is more inline with what other databases do. Added test coverage in parser tests and core e2e tests. Change-Id: Iafc5cc8122e88501f0a5595ee51ba2dc7556ec4a
stoty
commented
Jul 30, 2021
💔 -1 overall
This message was automatically generated. |
dbwong
commented
Jul 30, 2021
One thing that wasn't entirely clear to me was were we considering views in the base JIRA or only tables for the initial scope? |
dbwong
left a comment
There was a problem hiding this comment.
See above for question on views but what is the expected output when we call show on an index table?
| assertEquals("SYSTEM", rs.getString("TABLE_SCHEM")); | ||
| } | ||
| assertEquals(8, tables.size()); | ||
| assertTrue(tables.contains("CATALOG")); |
There was a problem hiding this comment.
Since this is a user facing feature i think we should probably test against exact string we expect as people may end up relying on the message.
There was a problem hiding this comment.
In line 396 we add what is in the TABLE_NAME column to the set called tables, here we assert that CATALOG and FUNCTION is in that set of tables.
Hey @dbwong I'll try to answer your questions but I am not the original owner of the ticket. |
This patch adds new SQL grammar like following
Example invocations:
The current way of fetching this information is by using
!tables and !schemas via sqlline JDBC support but that is
not flexible enough for the end users to add more fitlers.
This approach is more inline with what other databases do.
Added test coverage in parser tests and core e2e tests.