一、如果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是需要保留的小数位数
六、当在where条件中做判断的时候一定要小心NULL值,比如:
select null<>'-1';
+-------+--+
| _c0 |
+-------+--+
| NULL |
+-------+--+
结果并不是true or false