Skip to content

0.5,0.9位置估算

用approx_percentile函数得出0.5对应的值,和0.9对应的值, 自定义的百分位 [0.5,0.9] 作为X轴 返回结果作为 Y轴, 以柱状图展示

SQL
* |
select
  k,
  v
from(
    select
      map(array [0.5,0.9], p) as m
    from(
        select
          approx_percentile(upstream_response_time, array [0.5,0.9]) as p
        from
          log
      )
  ),
  unnest(m) as t(k, v)

SQL查询结果样例:

样例图片