Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ea-rus committed Nov 1, 2024
1 parent b735f13 commit 589b1f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mindsdb_sql/planner/plan_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ def _check_conditions(node, **kwargs):
conditions.append(node)
elif table2 is not None:
node.args = [arg1, arg2]
node = copy.deepcopy(node)
data_conditions.append(node)

query_traversal(fetch_table.join_condition, _check_conditions)
Expand All @@ -501,12 +502,13 @@ def _check_conditions(node, **kwargs):

# extract distinct values
# remove alias
arg2 = Identifier(parts=[arg2.parts[-1]])
arg2.parts = arg2.parts[-1:]
query2 = Select(targets=[arg2], distinct=True)
subselect_step = SubSelectStep(query2, fetch_step.result)
subselect_step = self.add_plan_step(subselect_step)

condition.args[1] = Parameter(subselect_step.result)
condition.op = 'in'
conditions.append(condition)

return conditions
Expand Down

0 comments on commit 589b1f0

Please sign in to comment.