1.1 - 8.10 - PathSummarizer Example - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Published
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)
Last Update
2019-12-31

Input

SQL Call

SELECT * FROM PathSummarizer (
  ON PathGenerator (
    ON clickstream1
    USING
    SeqColumn ('path')
    Delimiter (',')
  ) PARTITION BY prefix
  USING
  SeqColumn ('sequence')
  PrefixColumn ('prefix')
  PartitionNames ('prefix')
  Delimiter(',')
  CountColumn ('cnt')
  HashCode ('false')
) AS dt ORDER BY node, cnt ASC;

Output

 node                parent            children                  cnt depth prefix            
 ------------------- ----------------- ------------------------- --- ----- ----------------- 
 ^,a                 ^                 [(^,a,h),(^,a,p)]          11     1 ^,a              
 ^,a,h               ^,a               [(^,a,h,c),(^,a,h,p)]       5     2 ^,a,h            
 ^,a,h,c             ^,a,h             [(^,a,h,c,$)]               3     3 ^,a,h,c          
 ^,a,h,c,$           ^,a,h,c                                       3     4 ^,a,h,c          
 ^,a,h,p             ^,a,h             [(^,a,h,p,$)]               2     3 ^,a,h,p          
 ^,a,h,p,$           ^,a,h,p                                       2     4 ^,a,h,p          
 ^,a,p               ^,a               [(^,a,p,s)]                 6     2 ^,a,p            
 ^,a,p,s             ^,a,p             [(^,a,p,s,o)]               6     3 ^,a,p,s          
 ^,a,p,s,o           ^,a,p,s           [(^,a,p,s,o,)]              6     4 ^,a,p,s,o        
 ^,c                 ^                 [(^,c,s)]                   1     1 ^,c              
 ^,c,s               ^,c               [(^,c,s,o)]                 1     2 ^,c,s            
 ^,c,s,o             ^,c,s             [(^,c,s,o,e)]               1     3 ^,c,s,o          
 ^,c,s,o,e           ^,c,s,o           [(^,c,s,o,e,$)]             1     4 ^,c,s,o,e        
 ^,c,s,o,e,$         ^,c,s,o,e                                     1     5 ^,c,s,o,e        
 ^,h                 ^                 [(^,h,a),(^,h,c),(^,h,e)]  20     1 ^,h              
 ^,h,a               ^,h               [(^,h,a,c),(^,h,a,p)]       6     2 ^,h,a            
 ^,h,a,c             ^,h,a             [(^,h,a,c,p)]               4     3 ^,h,a,c          
 ^,h,a,c,p           ^,h,a,c           [(^,h,a,c,p,i)]             4     4 ^,h,a,c,p        
 ^,h,a,c,p,i         ^,h,a,c,p         [(^,h,a,c,p,i,s)]           4     5 ^,h,a,c,p,i      
 ^,h,a,c,p,i,s       ^,h,a,c,p,i       [(^,h,a,c,p,i,s,o)]         4     6 ^,h,a,c,p,i,s    
 ^,h,a,c,p,i,s,o     ^,h,a,c,p,i,s     [(^,h,a,c,p,i,s,o,e)]       4     7 ^,h,a,c,p,i,s,o  
 ^,h,a,c,p,i,s,o,e   ^,h,a,c,p,i,s,o   [(^,h,a,c,p,i,s,o,e,$)]     4     8 ^,h,a,c,p,i,s,o,e
 ^,h,a,c,p,i,s,o,e,$ ^,h,a,c,p,i,s,o,e                             4     9 ^,h,a,c,p,i,s,o,e
 ^,h,a,p             ^,h,a             [(^,h,a,p,i)]               2     3 ^,h,a,p          
 ^,h,a,p,i           ^,h,a,p           [(^,h,a,p,i,s)]             2     4 ^,h,a,p,i        
 ^,h,a,p,i,s         ^,h,a,p,i         [(^,h,a,p,i,s,o)]           2     5 ^,h,a,p,i,s      
 ^,h,a,p,i,s,o       ^,h,a,p,i,s       [(^,h,a,p,i,s,o,$)]         2     6 ^,h,a,p,i,s,o    
 ^,h,a,p,i,s,o,$     ^,h,a,p,i,s,o                                 2     7 ^,h,a,p,i,s,o    
 ^,h,c               ^,h               [(^,h,c,h),(^,h,c,p)]      12     2 ^,h,c            
 ^,h,c,h             ^,h,c             [(^,h,c,h,p)]               7     3 ^,h,c,h          
 ^,h,c,h,p           ^,h,c,h           [(^,h,c,h,p,$)]             7     4 ^,h,c,h,p        
 ^,h,c,h,p,$         ^,h,c,h,p                                     7     5 ^,h,c,h,p        
 ^,h,c,p             ^,h,c             [(^,h,c,p,e)]               5     3 ^,h,c,p          
 ^,h,c,p,e           ^,h,c,p           [(^,h,c,p,e,$)]             5     4 ^,h,c,p,e        
 ^,h,c,p,e,$         ^,h,c,p,e                                     5     5 ^,h,c,p,e        
 ^,h,e               ^,h               [(^,h,e,$)]                 2     2 ^,h,e            
 ^,h,e,$             ^,h,e                                         2     3 ^,h,e            
 ^,p                 ^                 [(^,p,c)]                   2     1 ^,p              
 ^,p,c               ^,p               [(^,p,c,p)]                 2     2 ^,p,c            
 ^,p,c,p             ^,p,c             [(^,p,c,p,s)]               2     3 ^,p,c,p          
 ^,p,c,p,s           ^,p,c,p           [(^,p,c,p,s,o)]             2     4 ^,p,c,p,s        
 ^,p,c,p,s,o         ^,p,c,p,s         [(^,p,c,p,s,o,e)]           2     5 ^,p,c,p,s,o      
 ^,p,c,p,s,o,e       ^,p,c,p,s,o       [(^,p,c,p,s,o,e,$)]         2     6 ^,p,c,p,s,o,e    
 ^,p,c,p,s,o,e,$     ^,p,c,p,s,o,e                                 2     7 ^,p,c,p,s,o,e

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.