16.20 - nPath範囲一致例1: 各セッションで訪問されたページ数の累積 - Teradata Vantage NewSQL Engine

Teradata Vantage™ - NewSQL Engineの分析関数

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
プログラミング リファレンス
featnum
B035-1206-162K-JPN

入力

入力テーブルは、LAG式とLEAD式の例2によるaggregate_clicksです。

SQL-MapReduce呼び出し

SELECT * FROM nPath (
  ON aggregate_clicks PARTITION BY sessionid ORDER BY clicktime
  USING
  Mode (NONOVERLAPPING)
  Pattern ('A*')
  Symbols (TRUE AS A)
  Result (
    FIRST (sessionid OF A) AS sessionid,
    ACCUMULATE (pagetype OF A) AS path
  )
) AS dt ORDER BY dt.sessionid;

nPath範囲一致例1の出力

sessionid path
1 [home, home1, page1, home, home1, page1, home, home, home, home1, page1, checkout, home, home, home, home, home, home, home, home, home]
2 [home, home, home, home, home, home, home, home, home, home1, page1, checkout, checkout, home, home]
3 [home, home, home, home, home, home, home, home, home1, page1, home, home1, page1, home]
4 [home, home, home, home, home, home, home1, home1, home1, page1, page1, page1]
5 [home, home, home, home, home1, home1, home1, page1, page1, page1, page2, page2, page2, checkout, checkout, checkout, page2, page2, page2]