CREATE TABLE IF NOT EXISTS Employee_Local( EmployeeId INT,Name STRING,
Designation STRING,State STRING, Number STRING)
ROW Format Delimited Fields Terminated by ',' STORED AS Textfile;
描述语句 您可以使用缩写desc作为describe语句。
hive> DESCRIBE Employee_Local;
OK
employeeid int
name string
designation string
state string
number string
描述格式化语句
hive> describe formatted Employee_Local;
OK
# col_name data_type comment
employeeid int
name string
designation string
state string
number string
# Detailed Table Information
Database: default
Owner: cloudera
CreateTime: Fri Mar 15 10:53:35 PDT 2019
LastAccessTime: UNKNOWN
Protect Mode: None
Retention: 0
Location: hdfs://quickstart.cloudera:8020/user/hive/warehouse/employee_test
Table Type: MANAGED_TABLE
Table Parameters:
transient_lastDdlTime 1552672415
# Storage Information
SerDe Library: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
InputFormat: org.apache.hadoop.mapred.TextInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Compressed: No
Num Buckets: -1
Bucket Columns: []
Sort Columns: []
Storage Desc Params:
field.delim ,
serialization.format ,
Time taken: 0.544 seconds, Fetched: 31 row(s)
1条答案
按热度按时间eh57zj3b1#
你可以用
DESCRIBE
语句,它显示有关表的元数据,如列名及其数据类型。这个
DESCRIBE FORMATTED
以apache hive用户熟悉的格式显示其他信息。例子:
我创建了一个如下表。
描述语句
您可以使用缩写desc作为describe语句。
描述格式化语句
甚至可以从spark shell获得配置单元表的模式,如下所示: