1、显示创建的hql语句
show tables;
show create table student_info;
hive (default)> show create table student_info;
OK
createtab_stmt
CREATE TABLE `student_info`(
`s_id` int,
`course` string,
`score` int,
`class_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://h201:9000/user/hive/warehouse/student_info'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'totalSize'='192',
'transient_lastDdlTime'='1485405074')
Time taken: 0.663 seconds, Fetched: 18 row(s)
2、desc查询表结构
show create table lxw1235;
hive (default)> show create table lxw1235;
OK
createtab_stmt
CREATE EXTERNAL TABLE `lxw1235`(
`cookieid` string,
`createtime` string,
`pv` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFo
show tables;
show create table student_info;
hive (default)> show create table student_info;
OK
createtab_stmt
CREATE TABLE `student_info`(
`s_id` int,
`course` string,
`score` int,
`class_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://h201:9000/user/hive/warehouse/student_info'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'totalSize'='192',
'transient_lastDdlTime'='1485405074')
Time taken: 0.663 seconds, Fetched: 18 row(s)
2、desc查询表结构
show create table lxw1235;
hive (default)> show create table lxw1235;
OK
createtab_stmt
CREATE EXTERNAL TABLE `lxw1235`(
`cookieid` string,
`createtime` string,
`pv` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFo