Hive Default Authorization - Legacy Mode has information about these DDL statements:
For SQL standard based authorization in Hive 0.13.0 and later releases, see these DDL statements:
These statements provide a way to query the Hive metastore for existing data and metadata accessible to this Hive system.
SHOW (DATABASES|SCHEMAS) [LIKE identifier_with_wildcards];
|
SHOW DATABASES or SHOW SCHEMAS lists all of the databases defined in the metastore. The uses of SCHEMAS and DATABASES are interchangeable – they mean the same thing.
The optional LIKE clause allows the list of databases to be filtered using a regular expression. Wildcards in the regular expression can only be '*' for any character(s) or '|' for a choice. Examples are 'employees', 'emp*', 'emp*|*ees', all of which will match the database named 'employees'.
SHOW TABLES [IN database_name] [identifier_with_wildcards];
|
SHOW TABLES
lists all the base tables and views in the current database (or the one explicitly named using the IN
clause) with names matching the optional regular expression. Wildcards in the regular expression can only be '*' for any character(s) or '|' for a choice. Examples are 'page_view', 'page_v*', '*view|page*', all which will match the 'page_view' table. Matching tables are listed in alphabetical order. It is not an error if there are no matching tables found in metastore. If no regular expression is given then all tables in the selected database are listed.
SHOW PARTITIONS table_name;
|
SHOW PARTITIONS lists all the existing partitions for a given base table. Partitions are listed in alphabetical order.
It is also possible to specify parts of a partition specification to filter the resulting list. For example:
SHOW PARTITIONS table_name PARTITION(ds=
'2010-03-03'
); -- (Note: Hive
0.6
and later)
SHOW PARTITIONS table_name PARTITION(hr=
'12'
); -- (Note: Hive
0.6
and later)
SHOW PARTITIONS table_name PARTITION(ds=
'2010-03-03'
, hr=
'12'
); -- (Note: Hive
0.6
and later)
|
SHOW PARTITIONS [db_name.]table_name [PARTITION(partition_spec)]; -- (Note: Hive
0.13
.
0
and later)
|
Example:
SHOW PARTITIONS databaseFoo.tableBar PARTITION(ds=
'2010-03-03'
, hr=
'12'
); -- (Note: Hive
0.13
.
0
and later)
|
SHOW TABLE EXTENDED [IN|FROM database_name] LIKE identifier_with_wildcards [PARTITION(partition_spec)];
|
SHOW TABLE EXTENDED will list information for all tables matching the given regular expression. Users cannot use regular expression for table name if a partition specification is present. This command's output includes basic table information and file system information like totalNumberFiles, totalFileSize, maxFileSize, minFileSize,lastAccessTime, and lastUpdateTime. If partition is present, it will output the given partition's file system information instead of table's file system information.
SHOW TBLPROPERTIES tblname;
SHOW TBLPROPERTIES tblname(
"foo"
);
|
The first form lists all of the table properties for the table in question one per row separated by tabs. The second form of the command prints only the value for the property that's being asked for.
SHOW CREATE TABLE ([db_name.]table_name|view_name);
|
SHOW CREATE TABLE shows the CREATE TABLE statement that creates a given table, or the CREATE VIEW statement that creates a given view.
SHOW [FORMATTED] (INDEX|INDEXES) ON table_with_index [(FROM|IN) db_name];
|
SHOW INDEXES shows all of the indexes on a certain column, as well as information about them: index name, table name, names of the columns used as keys, index table name, index type, and comment. If the FORMATTED keyword is used, then column titles are printed for each column.
SHOW COLUMNS (FROM|IN) table_name [(FROM|IN) db_name];
|
SHOW COLUMNS shows all the columns in a table including partition columns.
SHOW FUNCTIONS
"a.*"
;
|
SHOW FUNCTIONS lists all the user defined and builtin functions matching the regular expression. To get all functions use ".*"
Hive Default Authorization - Legacy Mode has information about these SHOW statements:
In Hive 0.13.0 and later releases, SQL standard based authorization has these SHOW statements:
SHOW LOCKS <table_name>;
SHOW LOCKS <table_name> EXTENDED;
SHOW LOCKS <table_name> PARTITION (<partition_spec>);
SHOW LOCKS <table_name> PARTITION (<partition_spec>) EXTENDED;
SHOW LOCKS (DATABASE|SCHEMA) database_name; -- (Note: Hive 0.13.0 and later; SCHEMA added in Hive 0.14.0)
|
SHOW LOCKS displays the locks on a table or partition. See Hive Concurrency Model for information about locks.
SHOW LOCKS (DATABASE|SCHEMA) is supported from Hive 0.13 for DATABASE (see HIVE-2093) and Hive 0.14 for SCHEMA (see HIVE-6601). SCHEMA and DATABASE are interchangeable – they mean the same thing.
When Hive transactions are being used, SHOW LOCKS returns this information (see HIVE-6460):
SHOW CONF <configuration_name>;
|
SHOW CONF returns a description of the specified configuration property.
Note that SHOW CONF does not show the current value of a configuration property. For current property settings, use the "set" command in the CLI or a HiveQL script (see Commands) or in Beeline (see Beeline Hive Commands).
SHOW TRANSACTIONS;
|
SHOW TRANSACTIONS is for use by administrators when Hive transactions are being used. It returns a list of all currently open and aborted transactions in the system, including this information:
SHOW COMPACTIONS;
|
SHOW COMPACTIONS returns a list of all tables and partitions currently being compacted or scheduled for compaction when Hive transactions are being used, including this information:
Compactions are initiated automatically, but can also be initiated manually with an ALTER TABLE COMPACT statement.