You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Shant Hovsepian (Jira)" <ji...@apache.org> on 2020/12/07 22:31:00 UTC
[jira] [Created] (IMPALA-10382) Predicate with coalesce on both
sides of LOJ isn't NULL filtering
Shant Hovsepian created IMPALA-10382:
----------------------------------------
Summary: Predicate with coalesce on both sides of LOJ isn't NULL filtering
Key: IMPALA-10382
URL: https://issues.apache.org/jira/browse/IMPALA-10382
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Shant Hovsepian
A query like the below will have the outer join simplified to an inner join when the predicate with coalesce isn't always NULL filtering.
{code:sql}
select t1.int_col from alltypestiny t1 left outer join alltypesagg t2 on t1.tinyint_col = t2.tinyint_col left outer join alltypes t3 on t1.int_col = t3.int_col where t2.tinyint_col >= coalesce(t1.int_col, t2.int_col);
{code}
{noformat}
functional> set ENABLE_OUTER_JOIN_TO_INNER_TRANSFORMATION=true;
functional> explain select t1.int_col from alltypestiny t1 left outer join alltypesagg t2 on t1.tinyint_col = t2.tinyint_col left outer join alltypes t3 on t1.int_col = t3.int_col where t2.tinyint_col >= coalesce(t1.int_col, t2.int_col);
Query: explain select t1.int_col from alltypestiny t1 left outer join alltypesagg t2 on t1.tinyint_col = t2.tinyint_col left outer join alltypes t3 on t1.int_col = t3.int_col where t2.tinyint_col >= coalesce(t1.int_col, t2.int_col)
+------------------------------------------------------------+
| Explain String |
+------------------------------------------------------------+
| Max Per-Host Resource Reservation: Memory=5.04MB Threads=8 |
| Per-Host Resource Estimates: Memory=287MB |
| |
| PLAN-ROOT SINK |
| 08:EXCHANGE [UNPARTITIONED] |
| 04:HASH JOIN [LEFT OUTER JOIN, PARTITIONED] |
| |--07:EXCHANGE [HASH(t3.int_col)] |
| | 02:SCAN HDFS [functional.alltypes t3] |
| 06:EXCHANGE [HASH(t1.int_col)] |
| 03:HASH JOIN [INNER JOIN, BROADCAST] |
| |--05:EXCHANGE [BROADCAST] |
| | 00:SCAN HDFS [functional.alltypestiny t1] |
| 01:SCAN HDFS [functional.alltypesagg t2] |
+------------------------------------------------------------+
Fetched 13 row(s) in 0.02s
{noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)