Skip to content

Commit

Permalink
[sql 168/208] test(clickhouse): add test for ibis-project#6838.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Dec 22, 2023
1 parent c0d6568 commit 950829b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SELECT
t0.a AS a,
t0.b AS b,
t1.c AS c,
t1.d AS d,
t1.c / (
t0.a - t0.b
) AS e
FROM unbound_table_0 AS t0
INNER JOIN unbound_table_1 AS t1
ON t0.a = t1.c
9 changes: 9 additions & 0 deletions ibis/backends/clickhouse/tests/test_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,12 @@ def test_array_join_in_subquery(snapshot):

out = ibis.clickhouse.compile(expr)
snapshot.assert_match(out, "out.sql")


def test_complex_join(snapshot):
t1 = ibis.table({"a": "int", "b": "int"})
t2 = ibis.table({"c": "int", "d": "int"})
t3 = t1.join(t2, t1.a == t2.c)
q = t3.mutate(e=t3.c / (t3.a - t3.b))
out = ibis.clickhouse.compile(q)
snapshot.assert_match(out, "out.sql")

0 comments on commit 950829b

Please sign in to comment.