7.00.02 - SQL-MapReduce Call - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Release Date
September 2017
Content Type
Programming Reference
User Guide
Publication ID
B700-1022-700K
Language
English (United States)

The tables impressions and clicks have a user_id column, but the table tv_spots is only a record of television advertisements shown, which any user might have seen. Therefore, tv_spots must be a dimension table.

SELECT * FROM npath (
  ON impressions PARTITION BY userid ORDER BY ts
  ON clicks2 PARTITION BY userid ORDER BY ts
  ON tv_spots DIMENSION ORDER BY ts
  MODE ('nonoverlapping')
  SYMBOLS (true as imp, true as click, true as tv_imp)
  PATTERN ('(imp|tv_imp)*.click')
  RESULT (COUNT(* of imp) as imp_cnt,
          COUNT (* of tv_imp) as tv_imp_cnt)
) ORDER BY imp_cnt;