入力
入力テーブルは、LAG式とLEAD式の例: 入力問合わせの別名なしによるaggregate_clicksです。
SQL-MapReduce呼び出し
SELECT * FROM nPath (
ON aggregate_clicks PARTITION BY sessionid ORDER BY clicktime
USING
Mode (OVERLAPPING)
Pattern ('A.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範囲一致例の出力
| sessionid | path |
|---|---|
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [checkout, home] |
| 1 | [page1, checkout] |
| 1 | [home1, page1] |
| 1 | [home, home1] |
| 1 | [home, home] |
| 1 | [home, home] |
| 1 | [page1, home] |
| 1 | [home1, page1] |
| 1 | [home, home1] |
| 1 | [page1, home] |
| 1 | [home1, page1] |
| 1 | [home, home1] |
| 2 | [home, home] |
| 2 | [checkout, home] |
| 2 | [checkout, checkout] |
| ..。 | ..。 |