SQL-MapReduce Call - Aster Analytics

Teradata Aster Analytics Foundation User Guide

Product
Aster Analytics
Release Number
6.21
Published
November 2016
Language
English (United States)
Last Update
2018-04-14
dita:mapPath
kiu1466024880662.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1021
lifecycle
previous
Product Category
Software

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;