Skip to content

Commit

Permalink
Cleanup select builder in full join transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas committed Oct 3, 2024
1 parent 55da21d commit 7ecd519
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sqlglot/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,7 @@ def eliminate_full_outer_join(expression: exp.Expression) -> exp.Expression:
)

full_outer_join.set("side", "left")
anti_join_clause = (
exp.Select(expressions=[exp.Literal(this=1, is_string=False)])
.from_(expression.args["from"])
.where(join_conditions)
)
anti_join_clause = exp.select("1").from_(expression.args["from"]).where(join_conditions)
expression_copy.args["joins"][index].set("side", "right")
expression_copy = expression_copy.where(exp.Exists(this=anti_join_clause).not_())
expression_copy.args.pop("with", None) # remove CTEs from RIGHT side
Expand Down

0 comments on commit 7ecd519

Please sign in to comment.