大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
create table mydb.userinfo(name string,addressi string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;
CREATE TABLE mydb.userinfo --创建表
(col1 string, col2 date, col3 double),
partitioned by (datekey date), --可以多个字段的组合分区
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
Stored AS TEXTFILE;
load data local inpath "/home/dahaizi/data/userinfo.txt"
overwrite into table mydb.userinfo;
insert into table(col1,col2,col3) values('a','b','c')
成都创新互联专注于南沙网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供南沙营销型网站建设,南沙网站制作、南沙网页设计、南沙网站官网定制、成都微信小程序服务,打造南沙网络公司原创品牌,更为您提供南沙网站排名全网营销落地服务。
INSERT INTO TABLE table_Name
PARTITION (DateKey),
SELECT col1,col2,col3,DateKey FROM otherTable
WHERE DATEKEY IN ('2017-02-26','2013-06-12','2013-09-24'),
GROUP BY col1,col2,col3,DateKey
DISTRIBUTE BY DateKey
insert overwrite directory '/jc_bdcqs/qsy'
row format delimited
fields terminated by ','
select * from zqs_gs_g60_0730_list;
!quit
1)设置计算容错率(防止因计算过程出错而异常退出程序):set mapred.max.map.failures.percent=100;
2)限制查询输出文件的个数set mapred.reduce.tasks=1;
3) 控制最大reduce的数量,不会影响mapred.reduce.tasks的设置set hive.exec.reducers.max = 100;
4) 一个job会有多少个reducer来处理,默认为1Gset hive.exec.reducers.bytes.per.reducer = 1000000000;
设置动态分区
set hive.exec.dynamic.partition=true;(可通过这个语句查看:set hive.exec.dynamic.partition;),
set hive.exec.dynamic.partition.mode=nonstrict;
SET hive.exec.max.dynamic.partitions=100000;(如果自动分区数大于这个参数,将会报错),
SET hive.exec.max.dynamic.partitions.pernode=100000;
drop table tb_name;
或清空表truncate table table_name;
ALTER TABLE table_Name DROP PARTITION (Datekey='20190606');
alter table tb_name add partition (Datekey = ‘20190606’);