[
https://issues.apache.org/jira/browse/PHOENIX-5543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17391422#comment-17391422
]
ASF GitHub Bot commented on PHOENIX-5543:
-----------------------------------------
richardantal edited a comment on pull request #1278:
URL: https://github.com/apache/phoenix/pull/1278#issuecomment-890810753
Hey @dbwong
This is a backport PR, we already have this in the 4.x, master and 5.1
branches, 4.16 just got forgotten.
I'll try to answer your questions but I am not the original owner of the
ticket.
It will list tables, views and indexes as well.
The output is the same as the output for `!tables` and `!schemas` command,
here it is possible to filter those results.
```
jdbc:phoenix:localhost:65205> show tables like 'foo%';
+-----------+-------------+------------+------------+---------+-----------+---------------------------+----------------+-------------+----------------+--------------+--------------+----------------+-----------+------------+---------------+---------------------+-------------------+---------+
| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_NAME |
SELF_REFERENCING_COL_NAME | REF_GENERATION | INDEX_STATE | IMMUTABLE_ROWS |
SALT_BUCKETS | MULTI_TENANT | VIEW_STATEMENT | VIEW_TYPE | INDEX_TYPE |
TRANSACTIONAL | IS_NAMESPACE_MAPPED | GUIDE_POSTS_WIDTH | TRANSAC |
+-----------+-------------+------------+------------+---------+-----------+---------------------------+----------------+-------------+----------------+--------------+--------------+----------------+-----------+------------+---------------+---------------------+-------------------+---------+
| | | foo_ind | INDEX | | |
| | ACTIVE | false | null
| false | | | GLOBAL | false
| false | null | |
| | | foo_1 | TABLE | | |
| | | false | null
| false | | | | false
| false | null | |
| | | foo_view | VIEW | | |
| | | false | null
| false | | UPDATABLE | | false
| false | null | |
+-----------+-------------+------------+------------+---------+-----------+---------------------------+----------------+-------------+----------------+--------------+--------------+----------------+-----------+------------+---------------+---------------------+-------------------+---------+
3 rows selected (0.023 seconds)
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
> Implement show schemas / show tables SQL commands
> -------------------------------------------------
>
> Key: PHOENIX-5543
> URL: https://issues.apache.org/jira/browse/PHOENIX-5543
> Project: Phoenix
> Issue Type: Improvement
> Affects Versions: 4.15.0, 5.1.0
> Reporter: Bharath Vissapragada
> Assignee: Bharath Vissapragada
> Priority: Minor
> Fix For: 5.1.0, 4.16.1, 4.17.0
>
> Attachments: PHOENIX-5543-4.x.v1.patch, PHOENIX-5543.master.v1.patch,
> PHOENIX-5543.master.v2.patch, PHOENIX-5543.master.v3.patch
>
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> Currently users rely on {{!tables}} and {{!schemas}} commands provided by
> sqlline which pulls the information using the standard JDBC metadata calls
> like {{getTables()}} and {{getSchemas()}}.
> Most other databases (like mysql[1,2]) implement these as first class SQL
> commands that gives the user more flexibility in querying by adding necessary
> filters and looking up for table information in specific schemas. The ask
> here is to implement the following SQL commands.
> {noformat}
> SHOW SCHEMAS [LIKE '<pattern>']
> SHOW TABLES [IN <schema>] [LIKE '<pattern>']
> {noformat}
> [1] https://dev.mysql.com/doc/refman/8.0/en/show-tables.html
> [2] https://dev.mysql.com/doc/refman/8.0/en/show-databases.html
--
This message was sent by Atlassian Jira
(v8.3.4#803005)