Recursively search the logical plan to detect cyclic view references, throw an AnalysisException if cycle detected.
Recursively search the logical plan to detect cyclic view references, throw an AnalysisException if cycle detected.
A cyclic view reference is a cycle of reference dependencies, for example, if the following
statements are executed:
CREATE VIEW testView AS SELECT id FROM tbl
CREATE VIEW testView2 AS SELECT id FROM testView
ALTER VIEW testView AS SELECT * FROM testView2
The view testView
references testView2
, and testView2
also references testView
,
therefore a reference cycle (testView -> testView2 -> testView) exists.
the logical plan we detect cyclic view references from.
the path between the altered view and current node.
the table identifier of the altered view, we compare two views by the
desc.identifier
.
Generate the view properties in CatalogTable, including: 1.
Generate the view properties in CatalogTable, including: 1. view default database that is used to provide the default database name on view resolution. 2. the output column names of the query that creates a view, this is used to map the output of the view child to the view output during view resolution.
the properties
in CatalogTable.
the spark session.
the analyzed logical plan that represents the child of a view.
new view properties including view default database and query column names properties.