Spark sql HLL函数

编程入门 行业动态 更新时间:2024-10-28 01:18:54

HLL函数

预估函数:presto_estimate_prepare(预估计算)

合并函数:presto_estimate_merge(创建binary格式数据,用于后续计算)

计算函数:presto_estimate_compute(对binary格式数据进行计算,类似拟合计算count distinct)

概念说明:https://www.bookstack/read/Doris/spilt.9.spilt.7.11.md

 --presto_estimate_compute(`hll_arry列`)
SELECT 
	t_a.scene_of_flow_name                            						AS `活动类型` 
	,t_b.new_category_1st_name  										AS `一级类目` 
	,t_b.new_category_3rd_name                            			  	AS `三级类目` 
	,sum(pv_1d)                                                                      AS`曝光页面数`
	,presto_estimate_compute(uv_hll_1d) 							AS `UV` 
	,sum(goods_acture_amt_1d)											AS `销售额(含退拒)` 
	,sum(result_goods_acture_amt_1d)								AS `销售额(不含退拒)` 
	,sum(goods_acture_num_1d)										AS `销量(含退拒)` 
	,sum(result_goods_acture_num_1d )							AS `销量(不含退拒)` 
	,sum(cart_cnt_1d)                                                            AS `加购数` 
	,presto_estimate_compute(user_num_hll_1d) 			AS `客户数` 
	,presto_estimate_compute(order_num_hll_1d) 			AS `订单数` 
	,count(DISTINCT t_b.spu_id)                                          AS `SPU数` 
	,count(DISTINCT t_a.merchandise_no)                        AS `商品数` 
FROM
	t_a
GROUP BY
	t_a.scene_of_flow_name                

更多推荐

Spark sql HLL函数

本文发布于:2023-06-14 05:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1444634.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   Spark   sql   HLL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!