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                
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值