[ https://issues.apache.org/jira/browse/IMPALA-10382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17245561#comment-17245561 ]
Shant Hovsepian commented on IMPALA-10382: ------------------------------------------ [~xqhe] I assigned this to you if you want to take a pass at it, otherwise I can't try for the fix. > 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 > Assignee: Xianqing He > Priority: Major > > 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) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org For additional commands, e-mail: issues-all-h...@impala.apache.org