1. 程式人生 > >爬坑:hive的NULL值過濾

爬坑:hive的NULL值過濾

hive的底層儲存的是’NULL’是個字串,想要過濾掉NULL值,使用is not null無效

insert overwrite local directory '/home/hadoop/zoujc/result'
select distinct username
from
xxxtable
where lower(password) != 'abnormal' 
and password != '' and password != 'NULL' and password != 'null'
and to_date(LastLoginTime) >= '2017-10-14' and to_date
(LastLoginTime) <= '2018-04-14' order by username