hive 调用java的函数和科学记数法转换

hive中field如果是string,比如id,那么使用10000000000+id结果是科学计数法显示,转换为正常显示方法:

select (10000000000+cast(id as int))  as id from tb1 limit 10;

hive 调用java的函数,必须是静态类函数

select reflect ("java.lang.String","valueOf",id) from tb1 limit 1;

select reflect ("java.lang.Long","valueOf",(10000000000+cast(id as int)))  as id from tb1 limit 10;

https://cwiki.apache.org/confluence/display/Hive/ReflectUDF

上一篇:apache用户认证、域名跳转、Apache访问日志(两种格式)


下一篇:Scrum Meeting Alpha - 6