FUNNELEVENTSFUNCTIONEVAL 함수

FUNNELEVENTSFUNCTIONEVAL 함수

Apache Pinot의 FUNNELEVENTSFUNCTIONEVAL 집계 함수는 완료된 윈도우 펀넬(funnel) 실행을 평가하고 일치하는 각 단계에 대해 선택한 추가 필드 값을 반환해요. 퍼널 분석에서 각 단계의 부가 정보를 함께 뽑아낼 때 유용해요.

출처: 문서

본문

FUNNELEVENTSFUNCTIONEVAL 함수는 완료된 윈도우 펀넬 실행을 평가하고 일치하는 각 단계에 대해 선택한 추가 필드 값을 반환해요.

시그니처

FUNNELEVENTSFUNCTIONEVAL(timestampExpression, windowSize, numberSteps, stepExpression1, ..., stepExpressionN, extraFieldCount, extraFieldExpression1, ..., extraFieldExpressionM [, '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.
extraFieldCount Number of extra-field expressions to capture for each matched step. This must match the number of extra-field expressions that follow.
extraFieldExpression1 ... extraFieldExpressionM Expressions whose values should be returned for each matched step. Pinot converts the returned values to strings.
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=....

반환 값

STRING[]를 반환해요.

첫 번째 요소는 헤더 문자열이에요:

  • 첫 번째 숫자는 일치한 퍼널 실행 수
  • 그다음의 각 숫자는 그 일치한 실행에 대해 방출된 평탄화된 추가 필드 값의 수

나머지 배열 요소들은 완료된 각 퍼널 실행에 대해 일치한 단계 순서대로 평탄화된 요청한 추가 필드 값이에요.

Pinot이 완료된 퍼널 실행을 찾지 못하면 결과에는 0만 들어 있어요.

예시

SELECT
  userId,
  funnelEventsFunctionEval(
    timestampCol,
    '1000',
    4,
    url = '/product/search',
    url = '/cart/add',
    url = '/checkout/start',
    url = '/checkout/confirmation',
    3,
    timestampCol,
    userId,
    url
  ) AS funnelEvents
FROM events
GROUP BY userId
ORDER BY userId

단일 4단계 퍼널이 일치한 경우, Pinot의 통합 테스트는 다음과 같은 STRING[]을 반환해요:

["1, 12", "1000", "user00", "/product/search", "1010", "user00", "/cart/add", ...]

여기서 1, 12는 일치한 퍼널 실행이 1개이고 헤더 뒤에 평탄화된 추가 필드 값이 12개(4 steps * 3 extra fields)라는 뜻이에요.

관련 퍼널 함수에 대한 자세한 내용은 Funnel Analysis Functions를 참고하세요.

더 알아보기 (Learn more)