16.10 - Usage Notes for the PARTITION BY, DIMENSION, and ORDER BY Clauses - Teradata Database
Teradata Analytic Functions
- Teradata Database
- November 2017
- Programming Reference
- The PARTITION BY expression defines the scope of a partition of input rows over which nPath searches for pattern matches.
- The Teradata PARTITION BY clause allows the column position to be specified instead of the column name, which determines how the rows are partitioned.
- The DIMENSION expression duplicates the input table on all the AMPs and can only be used when there are multiple inputs.
- When multiple PARTITION BY and DIMENSION inputs are specified for nPath, the inputs are handled as follows: An input buffer is constructed for multiple inputs in each partition. For partition by key input, the buffer consists of the rows whose partition number matches the partition number of this input buffer. For DIMENSION input, all the rows of the table are inserted into the buffer. The rows are then sorted by the corresponding ORDER BY clause (if any) of each input. The nPath function then processes the rows in the input buffer sequentially. Note that nPath is designed to find the pattern within one partition only.
- The ORDER BY expression specifies the sort-order of the input rows.