hive的内部所有函数,也可以自己实现udf

--hive笔记:
select hex(17),unhex(11) from szq.ods_hbase_to_hive limit 2;
--10进制转16进制
select bin(10),hex(18),unhex(11),round(3,14444),conv(14,10,16),abs(-11),from_unixtime(32849032849,'YYYY-MM-DD HH:MM'),unix_timestamp('2021-07-21 23:00:00'),to_date('2021-07-20 23:20:33'),
year('2021-07-08 12:12:12'),datediff('2021-07-21','2021-07-12'),date_sub('2021-07-21',3),if(true,'this ok','this false'),coalesce(null,'bym'), --返回第一个非空值,类似于oracle的nvl函数
case 100 when 50 then '50' when 100 then '100 ok' else 'error'end,length('bym'),reverse('bianyanming'),concat_ws(',','bianyanming','yanming'),substr('bianyanming',0,3),
upper('adc'),trim(' dsjalf '),--regexp_replace('foo','^f'),,stddev_pop(1)
parse_url('https://www.baidu.com/','HOST'),repeat('ABC',3),ascii('abc'),cast(1 as bigint)
from szq.ods_hbase_to_hive limit 2;

posted @ 2021-07-27 14:36  堕落先锋  阅读(82)  评论(0编辑  收藏  举报