您的位置:首页 > 其它

日常工作积累

2017-11-07 21:50 211 查看
一、如果Hive中的表存储为parquet的格式,假如我们要改字段的名字,那么改完字段后,该字段的数据全变为NULL

create table temp.test1
(
id   string,
name string
)partitioned by(src_file_day string)
stored as parquet;

insert table temp.test1 partition(src_file_day='20171020') values('1','gg');

select * from temp.test1;



alter table temp.test1 change column id ids string;




二、kill掉正在运行的hive任务

yarn application -kill application_xxxxxxxxxxxxx_xxxxxx

application_xxxxxxxxxxxxx_xxxxxx从8088界面找对应任务的ID

三、字母、汉字、数字所占字节

一个字母:1个字节

一个数字:1个字节

一个汉字:2个字节

四、算法官网
https://algs4.cs.princeton.edu/home/
五、我们在做hive的表的时候,如果我们要保留几位小数,首先想到的就是round函数,但是,如果我们计算的指标数据量很大,那么就会出现科学计数法,往往我们不需要用科学计数法,我们可以用cast( zhibiao as decimal(n,m))       n是总的位数,m是需要保留的小数位数
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: