Presto: 'Equi criteria are empty, so INNER join should not have PARTITIONED distribution type' error

Created on 19 Mar 2020  路  4Comments  路  Source: prestosql/presto

While testing some queries previous to upgrading to Presto 331 we鈥檝e gotten this error in some of our queries Equi criteria are empty, so INNER join should not have PARTITIONED distribution type

SELECT
    CAST(c.created_at AS DATE),
    COUNT(*)
FROM example_catalog.public.table_a AS a 
LEFT JOIN example_catalog.public.table_b AS b ON a.b_id = b.id
LEFT JOIN example_catalog.public.table_c AS c ON b.id = c.b_id
WHERE 
    a.b_id = 13424 AND 
    c.created_at  >= CAST(NOW() AS DATE) 
GROUP BY 1
ORDER BY 1 DESC LIMIT 1
bug

Most helpful comment

All 4 comments

Repro steps:

USE tpch.tiny;

SELECT customer.name, count(*)
FROM lineitem
LEFT JOIN orders ON lineitem.orderkey = orders.orderkey
LEFT JOIN customer ON orders.custkey = customer.custkey
WHERE lineitem.orderkey = 1234
AND customer.name >= 'abc'
GROUP BY 1
ORDER BY 1 DESC LIMIT 1;

or, a simpler query:

SELECT count(*)
FROM lineitem
LEFT JOIN orders ON lineitem.orderkey = orders.orderkey
LEFT JOIN customer ON orders.custkey = customer.custkey
WHERE lineitem.orderkey = 1234
AND customer.name >= 'abc'

The above query was passing on 330 and fails on 331.

i bisected this to a5eb69529de6915e02d8a1ccd5cbf0a56a0b277b. cc @sopel39

Workaround

Disable dynamic filtering, eg

SET SESSION enable_dynamic_filtering = false;
Was this page helpful?
0 / 5 - 0 ratings