Presto: Left Join condition association does not support subqueries

Created on 8 Jul 2020  Â·  4Comments  Â·  Source: prestosql/presto

sql->whit tmp_auth as (select node_id, node_type from xxx.xxx.organization where status = '1' and node_type <> '0')
select t1.id, t2.name from xxx.xxx.test1 t1 left jon xxx.xxx.test2 t2 on t1.id = t2.o_id and t1.s_id in (select node_id from tmp_auth where node_id = 1) limit 10;

error message -> Column 't1.s_id' cannot be resolved

bug

Most helpful comment

Thanks for reporting this issue! The fix will be available in the next version (339).

All 4 comments

Can you show the schema of the test1 table? You can run DESCRIBE test1 to do so.

whit tmp_auth as (select node_id, node_type from xxx.xxx.organization where status = '1' and node_type <> '0')
select t1.id, t2.name from xxx.xxx.test1 t1 left jon xxx.xxx.test2 t2 on t1.id = t2.o_id and t1.s_id in (‘1’, ‘2’) limit 10;

That's ok, column 's_id' exists in the table

I was able to reproduce the issue with this query:

WITH
    t(x, y) AS (VALUES (1, 10), (2, 20)),
    u(x) AS (VALUES 1, 2),
    w(z) AS (VALUES 10, 20)
SELECT *
FROM t LEFT JOIN u ON t.x = u.x AND t.y IN (SELECT z FROM w);

Thanks for reporting this issue! The fix will be available in the next version (339).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BruceKellan picture BruceKellan  Â·  4Comments

findepi picture findepi  Â·  4Comments

jiangzhx picture jiangzhx  Â·  5Comments

lxynov picture lxynov  Â·  5Comments

electrum picture electrum  Â·  5Comments