/BigdataUdf

udf for hive , impala ,presto

Primary LanguageJava

BigdataUdf

udf for hive / impala

H3

CREATE  temporary FUNCTION h3encode AS 'com.hive.udf.h3.UDFH3Encode'
using jar 'hdfs://nameservice1:8020/user/hadoop/udf/BigdataUdf-1.0-SNAPSHOT-jar-with-dependencies.jar';

CREATE  temporary FUNCTION h3kring AS 'com.hive.udf.h3.GenericUDFH3kRing'
using jar 'hdfs://nameservice1:8020/user/hadoop/udf/BigdataUdf-1.0-SNAPSHOT-jar-with-dependencies.jar';

select longitude,latitude ,k 
from oyo_dw.dim_hotel t
lateral view explode(h3kring(h3encode(longitude,latitude,6),1))  tf as k

base64 加密/解密

select UDFDecodeBase64('hive');      -- 加密
select UDFEncodeBase64('aGl2ZQ==');  -- 解密

geohash

select geohash(lng,lat)

geo

经纬度转化

charutil

-- full_to_halfwidth
select full2halfwidth("814乡道阿斯蒂芬123/.12,412看2家1快2看了就2;看了2叫看来");

-- 字符拆分
select split_word_by_type('  shell类型的 ? 123 78号楼 809 ')['cn'],
split_word_by_type('  shell类型的 ? 123 78号楼 809 ')['en'],
split_word_by_type('  shell类型的 ? 123 78号楼 809 ')['num']