1.1 - 8.10 - PathStart Example - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

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

Input

SQL Call

SELECT * FROM PathStart (
	ON (
		SELECT * FROM PathSummarizer (
			ON PathGenerator (
				ON clickstream1
				USING
				SeqColumn ('path')
				Delimiter (',')
			) PARTITION BY prefix
			USING
			SeqColumn ('sequence')
			PrefixColumn ('prefix')
			PartitionNames ('prefix')
			Delimiter (',')
			CountColumn ('cnt')
			"Hash" ('false')
		) AS dt2
	) PARTITION BY (parent)
	USING
	CountColumn ('cnt')
	Delimiter (',')
	ParentColumn ('parent')
	PartitionNames ('partitioned')
	NodeColumn ('node')
) AS dt  ORDER BY depth ASC, node;

Output

 node              parent          children                  subpath_cnt depth partitioned       
 ----------------- --------------- ------------------------- ----------- ----- ----------------- 
 ^                                 [(^,a),(^,c),(^,h),(^,p)]          34     0 ^                
 ^,a               ^               [(^,a,h),(^,a,p)]                  11     1 ^,a              
 ^,c               ^               [(^,c,s)]                           1     1 ^,c              
 ^,h               ^               [(^,h,a),(^,h,c),(^,h,e)]          20     1 ^,h              
 ^,p               ^               [(^,p,c)]                           2     1 ^,p              
 ^,a,h             ^,a             [(^,a,h,c),(^,a,h,p)]               5     2 ^,a,h            
 ^,a,p             ^,a             [(^,a,p,s)]                         6     2 ^,a,p            
 ^,c,s             ^,c             [(^,c,s,o)]                         1     2 ^,c,s            
 ^,h,a             ^,h             [(^,h,a,c),(^,h,a,p)]               6     2 ^,h,a            
 ^,h,c             ^,h             [(^,h,c,h),(^,h,c,p)]              12     2 ^,h,c            
 ^,h,e             ^,h             [(^,h,e,$)]                         2     2 ^,h,e            
 ^,p,c             ^,p             [(^,p,c,p)]                         2     2 ^,p,c            
 ^,a,h,c           ^,a,h           [(^,a,h,c,$)]                       3     3 ^,a,h,c          
 ^,a,h,p           ^,a,h           [(^,a,h,p,$)]                       2     3 ^,a,h,p          
 ^,a,p,s           ^,a,p           [(^,a,p,s,o)]                       6     3 ^,a,p,s          
 ^,c,s,o           ^,c,s           [(^,c,s,o,e)]                       1     3 ^,c,s,o          
 ^,h,a,c           ^,h,a           [(^,h,a,c,p)]                       4     3 ^,h,a,c          
 ^,h,a,p           ^,h,a           [(^,h,a,p,i)]                       2     3 ^,h,a,p          
 ^,h,c,h           ^,h,c           [(^,h,c,h,p)]                       7     3 ^,h,c,h          
 ^,h,c,p           ^,h,c           [(^,h,c,p,e)]                       5     3 ^,h,c,p          
 ^,p,c,p           ^,p,c           [(^,p,c,p,s)]                       2     3 ^,p,c,p          
 ^,c,s,o,e         ^,c,s,o         [(^,c,s,o,e,$)]                     1     4 ^,c,s,o,e        
 ^,h,a,c,p         ^,h,a,c         [(^,h,a,c,p,i)]                     4     4 ^,h,a,c,p        
 ^,h,a,p,i         ^,h,a,p         [(^,h,a,p,i,s)]                     2     4 ^,h,a,p,i        
 ^,h,c,h,p         ^,h,c,h         [(^,h,c,h,p,$)]                     7     4 ^,h,c,h,p        
 ^,h,c,p,e         ^,h,c,p         [(^,h,c,p,e,$)]                     5     4 ^,h,c,p,e        
 ^,p,c,p,s         ^,p,c,p         [(^,p,c,p,s,o)]                     2     4 ^,p,c,p,s        
 ^,h,a,c,p,i       ^,h,a,c,p       [(^,h,a,c,p,i,s)]                   4     5 ^,h,a,c,p,i      
 ^,h,a,p,i,s       ^,h,a,p,i       [(^,h,a,p,i,s,o)]                   2     5 ^,h,a,p,i,s      
 ^,p,c,p,s,o       ^,p,c,p,s       [(^,p,c,p,s,o,e)]                   2     5 ^,p,c,p,s,o      
 ^,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,p,i,s,o     ^,h,a,p,i,s     [(^,h,a,p,i,s,o,$)]                 2     6 ^,h,a,p,i,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    
 ^,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

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