Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incorrect edges from execution. #384

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions compiler/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,9 @@ def PerformIterationClosure(self, allocator):
for d in iteration_predicates:
# We are not doing anything with the resulting SQL,
# as we only need the execution state updated.
translator.TranslateTable(d, None)
# We don't have actual dependency on top of stack, so we
# do not add any dependency edge.
translator.TranslateTable(d, None, edge_needed=False)

def FormattedPredicateSql(self, name, allocator=None):
"""Printing top-level formatted SQL statement with defines and exports."""
Expand Down Expand Up @@ -1274,11 +1276,13 @@ def __init__(self, program, allocator, execution):
self.allocator = allocator
self.execution = execution

def TranslateTableAttachedToFile(self, table, ground, external_vocabulary):
def TranslateTableAttachedToFile(self, table, ground, external_vocabulary,
edge_needed=True):
"""Translates file-attached table. Appends exports and defines."""
self.execution.dependency_edges.append((
table,
self.execution.workflow_predicates_stack[-1]))
if edge_needed:
self.execution.dependency_edges.append((
table,
self.execution.workflow_predicates_stack[-1]))
if table in self.execution.table_to_defined_table_map:
return self.execution.table_to_defined_table_map[table]
table_name = ground.table_name
Expand Down Expand Up @@ -1358,14 +1362,14 @@ def UnquoteParenthesised(cls, table):
return table[2:-2]
return table

def TranslateTable(self, table, external_vocabulary):
def TranslateTable(self, table, external_vocabulary, edge_needed=True):
"""Translating table to an SQL string in the FROM cause."""
if table in self.program.table_aliases:
return self.program.table_aliases[table]
ground = self.program.annotations.Ground(table)
if ground:
return self.TranslateTableAttachedToFile(
table, ground, external_vocabulary)
table, ground, external_vocabulary, edge_needed)
if table in self.program.defined_predicates:
if self.program.execution.With(table):
return self.TranslateWithedTable(table)
Expand Down