default:
hive> use default;
hive > describe database default;
OK
db_name comment location owner_name owner_type parameters
default Default Hive database hdfs://hadoop1:8020/user/hive/warehouse public ROLE
Time taken: 0.042 seconds, Fetched: 1 row(s)
show tables;
CREATE TABLE `dws.dws_resumeachieve_t_result_tmp03` (
`workno` string COMMENT '员工工号',
`employeename` string COMMENT '姓名',
`amount` string COMMENT '业绩',
`effectivedate` string COMMENT '生效时间',
`isleave` string COMMENT '是否离职',
`leavedate` string COMMENT '离职日期',
`addtime` string COMMENT '订单生成时间'
);
更改字段类型:
alter table dws.dws_resumeachieve_t_result_tmp01 change column addtime addtime string;
新增一个字段:
alter table dws.dws_resumeachieve_t_result_tmp01 add columns(ManageBranchNos string);
删除表字段:
HIVE alter table 语句结构:
CREATE TABLE test (
creatingTs BIGINT,
a STRING,
b BIGINT,
c STRING,
d STRING,
e BIGINT,
f BIGINT
);
如果需要删除 column f 列,可以使用以下语句:
ALTER TABLE test REPLACE COLUMNS (
creatingTs BIGINT,
a STRING,
b BIGINT,
c STRING,
d STRING,
e BIGINT
);
truncate table dws.dws_resumeachieve_t_result_tmp01
drop table dws.dws_resumeachieve_t_result_tmp03
show functions;
desc function extended substring;
http://www.cnblogs.com/smartloli/p/4288493.html
http://www.cnblogs.com/smartloli/p/4354291.html