Updated on 2022-11-18 GMT+08:00

SHOW TABLE/PARTITION EXTENDED

Syntax

SHOW TABLE EXTENDED [IN|FROM schema_name] LIKE 'identifier_with_wildcards' [PARTITION (partition_spec)]

Remarks

LIKE'identifier_with_wildcards' supports only '*' and '|'. If no table name meets the condition, an error is reported during query.

Description

This statement is used to display details about a table or partition.

Regular expressions can be used to match multiple tables at the same time, but cannot be used to match partitions.

The displayed information includes basic table information and file system information. The file system information includes the total number of files, total file size, maximum file length, minimum file length, last access time, and last update time. For a partition, the file system information of the specified partition is provided, instead of the file system information of the table where the partition is located.

Example

SHOW TABLE EXTENDED FROM default LIKE 'show_*' ;                                        tab_name                            
---------------------------------------------------------------
 tableName:show_table2                                         
 owner:admintest                                               
 location:hdfs://hacluster/user/hive/warehouse/show_table2     
 InputFormat:org.apache.hadoop.hive.ql.io.orc.OrcInputFormat   
 OutputFormat:org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat 
 columns:struct columns {int a}                                
 partitioned:false                                             
 partitionColumns:                                             
 totalNumberFiles:0                                            
 totalFileSize:0                                               
 LastAccessTime:0                                              
                                                               
 tableName:show_table1                                         
 owner:admintest                                               
 location:hdfs://hacluster/user/hive/warehouse/show_table1     
 InputFormat:org.apache.hadoop.hive.ql.io.orc.OrcInputFormat   
 OutputFormat:org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat 
 columns:struct columns {int a}                                
 partitioned:false                                             
 partitionColumns:                                             
 totalNumberFiles:0                                            
 totalFileSize:0                                               
 LastAccessTime:0                                              
                                                               
                                                               
(1 row)  
 
show table extended in default like 'from*|in*';
                           tab_name                            
---------------------------------------------------------------
 tableName:fromtable                                           
 owner:admintest                                               
 location:hdfs://hacluster/user/hive/warehouse/fromtable       
 InputFormat:org.apache.hadoop.hive.ql.io.orc.OrcInputFormat   
 OutputFormat:org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat 
 columns:struct columns {int a}                                
 partitioned:false                                             
 partitionColumns:                                             
 totalNumberFiles:0                                            
 totalFileSize:0                                               
 LastAccessTime:0                                              
                                                               
 tableName:intable                                             
 owner:admintest                                               
 location:hdfs://hacluster/user/hive/warehouse/intable         
 InputFormat:org.apache.hadoop.hive.ql.io.orc.OrcInputFormat   
 OutputFormat:org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat 
 columns:struct columns {int a}                                
 partitioned:false                                             
 partitionColumns:                                             
 totalNumberFiles:0                                            
 totalFileSize:0                                               
 LastAccessTime:0                                              
                                                         
                                                               
(1 row)