[Hive - LanguageManual] Describe
Describe
Describe Database
Version information
Icon
As of Hive 0.7.
DESCRIBE DATABASE [EXTENDED] db_name;DESCRIBE SCHEMA [EXTENDED] db_name; -- (Note: Hive 0.15.0 and later) |
DESCRIBE DATABASE shows the name of the database, its comment (if one has been set), and its root location on the filesystem. The uses of SCHEMA and DATABASE are interchangeable – they mean the same thing. DESCRIBE SCHEMA is added in Hive 0.15 (HIVE-8803).
EXTENDED also shows the database properties.
Describe Table/View/Column
DESCRIBE [EXTENDED|FORMATTED] [db_name.]table_name[.col_name ( [.field_name] | [.'$elem$'] | [.'$key$'] | [.'$value$'] )* ]; |
DESCRIBE shows the list of columns including partition columns for the given table. If the EXTENDED keyword is specified then it will show all the metadata for the table in Thrift serialized form. This is generally only useful for debugging and not for general use. If the FORMATTED keyword is specified, then it will show the metadata in a tabular format.
Note: DESCRIBE EXTENDED shows the number of rows only if statistics were gathered when the data was loaded (see Newly Created Tables), and if the Hive CLI is used instead of a Thrift client or Beeline. HIVE-6285 will address this issue. Although ANALYZE TABLE gathers statistics after the data has been loaded (see Existing Tables), it does not currently provide information about the number of rows.
If a table has a complex column then you can examine the attributes of this column by specifying table_name.complex_col_name (and '$elem$' for array element, '$key$' for map key, and '$value$' for map value). You can specify this recursively to explore the complex column type.
For a view, DESCRIBE EXTENDED or FORMATTED can be used to retrieve the view's definition. Two relevant attributes are provided: both the original view definition as specified by the user, and an expanded definition used internally by Hive.
Version information
Icon
In Hive 0.10.0 and earlier, no distinction is made between partition columns and non-partition columns while displaying columns for DESCRIBE TABLE. From Hive 0.12.0 onwards, they are displayed separately.
In Hive 0.13.0 and later, the configuration parameter hive.display.partition.cols.separately lets you use the old behavior, if desired (HIVE-6689). For an example, see the test case in the patch for HIVE-6689.
Bug fixed in Hive 0.10.0
Icon
Database qualifiers for table names were introduced in Hive 0.7.0, but they were broken for DESCRIBE until a bug fix in Hive 0.10.0 (HIVE-1977).
Display Column Statistics
Version information
Icon
As of Hive 0.14.0; see HIVE-7050 and HIVE-7051. (The FOR COLUMNS option of ANALYZE TABLE is available as of Hive 0.10.0.)
ANALYZE TABLE table_name COMPUTE STATISTICS FOR COLUMNS will compute column statistics for all columns in the specified table (and for all partitions if the table is partitioned). To view the gathered column statistics, the following statements can be used:
DESCRIBE FORMATTED [db_name.]table_name.column_name; -- (Note: Hive 0.14.0 and later)DESCRIBE FORMATTED [db_name.]table_name.column_name PARTITION (partition_spec); -- (Note: Hive 0.14.0 and later) |
See Statistics in Hive: Existing Tables for more information about the ANALYZE TABLE command.
Describe Partition
DESCRIBE [EXTENDED|FORMATTED] [db_name.]table_name PARTITION partition_spec; |
This statement lists metadata for a given partition. The output is similar to that of DESCRIBE table_name. Presently, the column information associated with a particular partition is not used while preparing plans.
Example:
DESCRIBE page_view PARTITION (ds='2008-08-08'); |
[Hive - LanguageManual] Describe的更多相关文章
- [HIve - LanguageManual] Hive Operators and User-Defined Functions (UDFs)
Hive Operators and User-Defined Functions (UDFs) Hive Operators and User-Defined Functions (UDFs) Bu ...
- [Hive - LanguageManual] Alter Table/Partition/Column
Alter Table/Partition/Column Alter Table Rename Table Alter Table Properties Alter Table Comment Add ...
- [Hive - LanguageManual ] ]SQL Standard Based Hive Authorization
Status of Hive Authorization before Hive 0.13 SQL Standards Based Hive Authorization (New in Hive 0. ...
- [Hive - LanguageManual ] Windowing and Analytics Functions (待)
LanguageManual WindowingAndAnalytics Skip to end of metadata Added by Lefty Leverenz, last edi ...
- [HIve - LanguageManual] Join Optimization (不懂)
Join Optimization Join Optimization Improvements to the Hive Optimizer Star Join Optimization Star S ...
- [Hive - LanguageManual] Import/Export
LanguageManual ImportExport Skip to end of metadata Added by Carl Steinbach, last edited by Le ...
- [Hive - LanguageManual] DML: Load, Insert, Update, Delete
LanguageManual DML Hive Data Manipulation Language Hive Data Manipulation Language Loading files int ...
- [Hive - LanguageManual] Statistics in Hive
Statistics in Hive Statistics in Hive Motivation Scope Table and Partition Statistics Column Statist ...
- [Hive - LanguageManual] Create/Drop/Alter Database Create/Drop/Truncate Table
Hive Data Definition Language Hive Data Definition Language Overview Create/Drop/Alter Database Crea ...
随机推荐
- C++工具系列博文合集
http://www.cnblogs.com/itech/category/240779.html
- Android:Logcat中找不到本应该输出的Log调试信息
1.有没有设置Logcat的filter, 2.如果选中了自定义的filter,Tag是否和程序中想查看的那条输出信息的Tag相同: 3.Level等级是否设置的太高. filter设置 点击loca ...
- 每用户订阅上的所有者 SID 不存在 (异常来自 HRESULT:0x80040207)
出现这个问题是因为pQueryFilter.WhereClause = "RoomNumber=" +cmbFromPoint.SelectedItem;中的cmbFromPoin ...
- 250. Count Univalue Subtrees
题目: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes ...
- NSMutableArray 排序
NSMutableArray *array1=[NSMutableArray arrayWithObjects:@"1",@"3",@"2" ...
- 利用 java.lang.Runtime.addShutdownHook() 钩子程序,保证java程序安全退出
以前在开发时只知道依靠数据库事务来保证程序关闭时数据的完整性. 但有些时候一个业务上要求的原子操作,不一定只包括数据库,比如外部接口或者消息队列.此时数据库事务就无能为力了. 这时我们可以依靠java ...
- laravel加载javascript库
一篇文章: Generating a Link to a Javascript File Problem You want your Blade template to load an externa ...
- c创建win窗口
windows程序设计示例: #include "windows.h" #pragma comment(lib, "winmm") LRESULT CALLBA ...
- struts2更新版本操作有关事项备注
struts2更新版本操作有关事项备注, 更新主要jar包:struts2-convention-plugin-version,struts2-core-version, struts2-spring ...
- POJ 3233 矩阵乘法
题意:求解A+A^2+...+A^k 题解: 1)利用通和公式,原式=(A^k+1 - A)(A - O)^-1 时间复杂度O(n^3lgk) 2)递归求解,A+A^2+...+A^k=(A+A^2+ ...