Skip to content

Separate implicit joins from other conditions #715

Closed Answered by antoni4040
antoni4040 asked this question in Q&A
Discussion options

You must be logged in to vote

Never mind, something like this worked:

for node in self.parsed.find_all(exp.EQ):
    left = node.this
    right = node.expression
    if isinstance(left, exp.Column) and isinstance(right, exp.Column):
        joins.append(
            (
                (left.table, left.alias_or_name), 
                (right.table, right.alias_or_name)
            )
        )
        joinLabels.append(
            (left.table + "." + left.alias_or_name, right.table + "." + right.alias_or_name)
        )

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by antoni4040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant