Hcatalog 简明教程
HCatalog - Show Tables
您通常希望列出数据库中的所有表或列出表中的所有列。显然,每个数据库都有自己列出表和列的语法。
You often want to list all the tables in a database or list all the columns in a table. Obviously, every database has its own syntax to list the tables and columns.
Show Tables 语句显示所有表的名称。默认情况下,它会列出当前数据库中的表,或者在 IN 子句中,在指定数据库中列出表。
Show Tables statement displays the names of all tables. By default, it lists tables from the current database, or with the IN clause, in a specified database.
本节描述如何列出 HCatalog 中当前数据库中的所有表。
This chapter describes how to list out all tables from the current database in HCatalog.
Show Tables Statement
SHOW TABLES 的语法如下 −
The syntax of SHOW TABLES is as follows −
SHOW TABLES [IN database_name] ['identifier_with_wildcards'];
以下查询显示表列表 −
The following query displays a list of tables −
./hcat –e "Show tables;"
成功执行查询后,你会看到以下响应−
On successful execution of the query, you get to see the following response −
OK
emp
employee
Time taken: 5.3 seconds