-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ir): self reference fields were incorrectly dereferenced to the p…
…arent relation
- Loading branch information
Showing
5 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ckends/tests/sql/snapshots/test_select_sql/test_self_join_subquery_distinct_equal/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
SELECT | ||
t7.r_name, | ||
t2.r_name, | ||
t7.n_name | ||
FROM tpch_region AS t2 | ||
INNER JOIN tpch_nation AS t3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,6 @@ WHERE | |
t1.y | ||
FROM foo AS t1 | ||
WHERE | ||
t1.dept_id = t1.dept_id | ||
t0.dept_id = t1.dept_id | ||
) AS t2 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from __future__ import annotations | ||
|
||
import ibis | ||
from ibis.expr.types.relations import dereference_mapping | ||
|
||
t = ibis.table( | ||
[ | ||
("int_col", "int32"), | ||
("double_col", "double"), | ||
("string_col", "string"), | ||
], | ||
name="t", | ||
) | ||
|
||
|
||
def dereference_expect(expected): | ||
return {k.op(): v.op() for k, v in expected.items()} | ||
|
||
|
||
def test_dereference_mapping_self_reference(): | ||
v = t.view() | ||
|
||
mapping = dereference_mapping([v.op()]) | ||
expected = dereference_expect({}) | ||
assert mapping == expected |