Application Programming Interface Guide > Built-in Procedures > Procedures Reference > GetColumnReferences
 
GetColumnReferences
Retrieve the column references of the specified view, table or procedure. The analysis is done whether or not the specified view or table is cached.
This built-in procedure is discussed in the section "View Column Dependencies and References" in the TDV User Guide.
Location
/lib/resource (procedure)
/services/databases/system/lineage/ (published resource)
Inputs
resourcePath: The path to the resource to analyze. This parameter is required.
columnFilter (optional): A comma-separated list of case-insensitive column names, indicating the columns whose references should be analyzed. Empty string or NULL indicates all columns in the view or table.
Outputs
columnReferences: A cursor whose rows encode column references, having the following columns:
columnName: The name of the resource column having the column reference encoded in the row.
referentResourcePath: The path to the resource containing the column reference.
referentResourceType: The type of the resource containing the column reference. The supported resource types are TDV SQL views in plain or published form.
referenceContext: One of the following:
In WITH clause: A reference within a WITH clause.
In SELECT clause as output: A reference that is projected by a SELECT clause.
In SELECT clause as input: A reference that is used, but not projected, by a SELECT clause.
In FROM clause: A reference within a FROM clause.
In WHERE clause: A reference within a WHERE clause.
In TIMESERIES clause: A reference within a TIMESERIES clause.
In GROUP BY clause: A reference within a GROUP BY clause.
In HAVING clause: A reference within a HAVING clause.
In ORDER BY clause: A reference within a ORDER BY clause.
referentColumnName: The name of the referent column. Populated only if referenceContext is in SELECT clause as output; otherwise, empty.
derivationKind: Populated only if referenceContext is in SELECT clause as output; otherwise, empty. One of the following:
direct: The value of the dependency is preserved by the dependent column
indirect: The value of the dependency is transformed by the dependent column.
cardinalityInfo: Populated only if referenceContext is in SELECT clause as output; otherwise, empty. When applicable, one of the following:
aggregate: An aggregate function is involved in the derivation of the dependent columns.
analytic: An analytic function is involved in the derivation of the dependent column.
reference: A textual representation of the column reference.
position: The line number and column number of the reference formatted as [line number],[column number]
Exceptions
IllegalArgumentException: If the viewPath is malformed, the specified resource cannot be found, or the specified resource is impacted.