FUNNELSTEPDURATIONSTATS 함수
FUNNELSTEPDURATIONSTATS 함수
Apache Pinot의 FUNNELSTEPDURATIONSTATS 집계 함수는 윈도우 퍼널(funnel) 일치에 대한 단계 간 지속 시간 통계를 계산해요. 각 퍼널 단계 사이의 소요 시간을 분석하고 싶을 때 유용해요.
출처: 문서
본문
FUNNELSTEPDURATIONSTATS 함수는 윈도우 퍼널 일치에 대한 단계 간 지속 시간 통계를 계산해요.
시그니처
FUNNELSTEPDURATIONSTATS(timestampExpression, windowSize, numberSteps, stepExpression1, ..., stepExpressionN, 'durationFunctions=...' [, 'mode=...' | 'strict_order' | 'strict_deduplication' | 'strict_increase' | 'keep_all' | 'maxStepDuration=...'])
파라미터
| Parameter | Description |
|---|---|
timestampExpression |
Expression that evaluates to the event timestamp. Pinot accepts TIMESTAMP or LONG values. |
windowSize |
Positive time window literal. Funnel steps must complete within this window. |
numberSteps |
Number of funnel steps. This must match the number of step expressions that follow. |
stepExpression1 ... stepExpressionN |
Boolean expressions that define each funnel step in order. |
'durationFunctions=...' |
Required config string listing the statistics to emit. Supported values are COUNT, AVG, MIN, MEDIAN, MAX, and PERCENTILE<value> such as PERCENTILE95. The output preserves the requested function order. |
| Optional trailing arguments | Optional funnel controls shared with the other window funnel functions, including mode=..., strict_order, strict_deduplication, strict_increase, keep_all, and maxStepDuration=.... |
반환 값
단계 순서대로 평탄화된 DOUBLE[]을 반환해요.
각 단계에 대해 Pinot은 durationFunctions에 나열된 순서와 같은 순서로 요청한 통계를 방출해요. COUNT를 요청하면 Pinot은 모든 단계에 대해 그 값을 포함해요. 마지막 단계의 지속 시간 지표는 비교할 다음 단계가 없으므로 Pinot의 double null 자리값을 사용해요.
COUNT를 생략하고 완료된 퍼널이 없으면 Pinot은 빈 배열을 반환해요.
예시
SELECT
userId,
funnelStepDurationStats(
timestampCol,
'1000',
4,
url = '/product/search',
url = '/cart/add',
url = '/checkout/start',
url = '/checkout/confirmation',
'durationFunctions=count,avg,min,median,percentile95,max'
) AS statsArray
FROM events
GROUP BY userId
HAVING arrayLength(statsArray) > 0
ORDER BY userId
Pinot의 통합 테스트에서 단계 사이에 10밀리초 간격이 있는 완료된 4단계 퍼널은 다음과 같은 지속 시간 통계를 반환해요:
- step 0 -> step 1:
count=1,avg=10,min=10,median=10,percentile95=10,max=10 - step 1 -> step 2: 같은 6개 값
- step 2 -> step 3: 같은 6개 값
관련 퍼널 함수에 대한 자세한 내용은 Funnel Analysis Functions를 참고하세요.