![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hivesql优化
一方诸侯
这个作者很懒,什么都没留下…
展开
-
hive将某一列拼接成json数组
刚才是用的 collect_list(concat(’{’,concat(’“id_penyelenggara”:’,’“810114”’,’,’), concat('"id_pengguna":','"',a.id_pengguna,'",'), concat('"no_identitas_perwakilan":','"',no_identitas_perwakilan),'"}')) as values 但是得到的结果这原创 2021-02-03 17:34:40 · 2169 阅读 · 0 评论 -
hive隐式转化的问题
hive在表关联时尽量避免隐式转化,可以使用cast强转,下面例子中tableA表的order_no是bigint类型,tableB的order_no是string类型 select a.order_no, c.order_no as c_order_no, a.order_no=c.order_no from tableA a left join tableB b on a.order_no=b.order_no left join (select t1.order_no from tableA t1 j原创 2021-01-06 18:21:33 · 354 阅读 · 0 评论 -
hive sql优化
–一、json优化 –1.使用json_tuple –优化前 select create_time as model_time, to_date(create_time) as model_dt, uid as user_id, is_old_user, app_name, model as model_name, get_json_object(get_json_object(regexp_replace(result, ‘NaN’, ‘""’), ‘.savevariables′),′.save_var原创 2020-12-11 17:40:51 · 110 阅读 · 0 评论