SQL Expressions: Exclude CTEs from required Tables (#106479)
Fixes #105030 --------- Co-authored-by: Sam Jewell <2903904+samjewell@users.noreply.github.com>
This commit is contained in:
co-authored by
Sam Jewell
parent
c0e7701ad4
commit
1be9e60667
@@ -328,14 +328,6 @@ func buildGraphEdges(dp *simple.DirectedGraph, registry map[string]Node) error {
|
||||
for _, neededVar := range cmdNode.Command.NeedsVars() {
|
||||
neededNode, ok := registry[neededVar]
|
||||
if !ok {
|
||||
_, ok := cmdNode.Command.(*SQLCommand)
|
||||
// If the SSE is a SQL expression, and the node can't be found, it might be a CTE table name
|
||||
// CTEs are calculated during the evaluation of the SQL, so we won't have a node for them
|
||||
// So we `continue` in order to support CTE functionality
|
||||
// TODO: remove CTE table names from the list of table names during parsing of the SQL
|
||||
if ok {
|
||||
continue
|
||||
}
|
||||
return fmt.Errorf("unable to find dependent node '%v'", neededVar)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user