7.00.02 - gTree Arguments - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Published
September 2017
Content Type
Programming Reference
User Guide
Publication ID
B700-1022-700K
Language
English (United States)
Last Update
2018-04-17
TargetKey
Specifies the names of the columns in the edges table that identify the target vertex of an edge.
AllowCycles
[Optional] Specifies whether the input graph can include cycles. Default: 'false'.
MaxIterNum
[Optional] Specifies the maximum depth to which the function traverses the graph (a nonnegative integer). Default: 1000.
Output
[Optional] Specifies whether the function outputs all paths ('all') or only paths that end by reaching a leaf vertex, a cycle, or the maximum number of iterations ('end'). Default: 'end'.
Results
[Required if you omit EdgeResults.] Specifies the aggregate functions that the function calculates along each vertex in each path (see the following table). The function outputs a results column for each aggregate function. The column name is alias, if specified; otherwise it is func(expr).
EdgeResults
[Required if you omit Results.] Specifies the aggregate functions that the function calculates along each edge in each path (see the following table). The function outputs a results column for each aggregate function. The column name is alias, if specified; otherwise it is func(expr).
FinalEdgeFlag
[Optional] Specifies whether the function includes the edge that follows the final vertex when calculating the functions that EdgeResults specifies. Default: 'true'.

The following table describes the aggregate functions that the Results and EdgeResults arguments support. In function syntax, expr, expr1, and expr2 are values from the vertices or edges table.

Aggregate Functions Supported by gTree Function
Aggregate Function Description Return Value Data Type
correl(expr1, expr2)
Returns the Pearson product-moment correlation between expr1 and expr2 on the path. DOUBLE PRECISION
count(expr [,...])
Returns the number of vertices in the path where no expr is null. INTEGER
countdistinct(expr)
Returns the number of distinct values of expr in the vertices on the path. INTEGER
current(expr)
Returns the value of expr at the final vertex in the path. Same as input
cycle()
Returns 'true' if the gTree function ends the path by completing a cycle (that is, by visiting a vertex a second time), 'false' otherwise.
Specify this function only in the EdgeResults argument.
BOOLEAN
histogram(expr)
Returns a JSON string that contains the counts of each distinct value of expr on the path. CHARACTER VARYING
leaf()
Returns 'true' if the gTree function ends the path by reaching a leaf vertex (that is, a vertex with no outgoing edges), 'false' otherwise. BOOLEAN
level()
Returns the number of vertices on the path from the root vertex to the last visited vertex. INTEGER
max(expr)
Returns the maximum value of expr over all vertices from the root vertex to the last visited vertex. Same as input
maxiteration()
Returns 'true' if the gTree function ends the path by reaching the maximum number of iterations specified by the MaxIterNum argument, 'false' otherwise. BOOLEAN
mean(expr)
Returns the mean value of expr over all vertices from the root vertex to the last visited vertex. DOUBLE PRECISION
min(expr)
Returns the minimum value of expr over all vertices from the root vertex to the last visited vertex. Same as input
path(expr[,...])
Returns a string that represents the path from the root vertex to the last visited vertex. The string has the form 'v1->v2->v3...' for a vertex path and '.-v1->.-v2->.-v3->...' for an edge path, where vn is the value of the nth expr. CHARACTER VARYING
propagate(expr)
Returns the value of expr at the root vertex. Same as input
range(expr)
Returns the difference between the minimum and maximum values of expr on the path (max(expr) - min(expr)). Same as input
stdev(expr)
Returns the standard deviation of expr over all vertices from the root vertex to the last visited vertex. DOUBLE PRECISION
sum(expr)
Returns the sum of expr over all vertices from the root vertex to the last visited vertex. Same as input
sumproduct(expr1, expr2)
Calculates the product of expr1 and expr2 at each vertex on the path and then returns the sum of the products. Same as input if expr1 and expr2 have the same type, otherwise numeric