hive 创建表

create table
create database xxx;
create external table if not exists xxx.userkey_sid_rank_expo(
userkey string,
sid string,
rec_time string,
rank string,
rtoken string,
expo string,
pv string,
duration string
)
partitioned by (dt string)
row format delimited
fields terminated by '\t'
;
insert data

从其他表中插入

insert overwrite table userkey_sid_rank
partition (dt='20181106') 
select
a.userkey
from table

从本地文件中插入

load  data local inpath '/xxx' into table xxx partition (dt=20190610);
add columns
alter table xxx add columns xx string;

你可能感兴趣的:(hadoop)