栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Spark sql HLL函数

Spark sql HLL函数

HLL函数:

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

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

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

概念说明:https://www.bookstack.cn/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                
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/710763.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号