From issues-return-230522-apmail-spark-issues-archive=spark.apache.org@spark.apache.org Mon Jul 1 09:31:03 2019 Return-Path: X-Original-To: apmail-spark-issues-archive@minotaur.apache.org Delivered-To: apmail-spark-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id A7B9E191F9 for ; Mon, 1 Jul 2019 09:31:01 +0000 (UTC) Received: (qmail 36457 invoked by uid 500); 1 Jul 2019 09:31:01 -0000 Delivered-To: apmail-spark-issues-archive@spark.apache.org Received: (qmail 36398 invoked by uid 500); 1 Jul 2019 09:31:01 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 36313 invoked by uid 99); 1 Jul 2019 09:31:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2019 09:31:01 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7DDD5E2C82 for ; Mon, 1 Jul 2019 09:31:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 20CEE25FF9 for ; Mon, 1 Jul 2019 09:31:00 +0000 (UTC) Date: Mon, 1 Jul 2019 09:31:00 +0000 (UTC) From: "Apache Spark (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (SPARK-28220) join foldable condition not pushed down when parent filter is totally pushed down MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SPARK-28220?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Apache Spark reassigned SPARK-28220: ------------------------------------ Assignee: Apache Spark > join foldable condition not pushed down when parent filter is totally pus= hed down > -------------------------------------------------------------------------= -------- > > Key: SPARK-28220 > URL: https://issues.apache.org/jira/browse/SPARK-28220 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.3.2, 3.0.0 > Reporter: liupengcheng > Assignee: Apache Spark > Priority: Major > > We encountered a issue that join conditions not pushed down when we are r= unning spark app on spark2.3, after carefully looking into the code and deb= ugging, we found that it's because there is a bug in the rule `PushPredicat= eThroughJoin`: > It will try to push parent filter down though the join, however, when the= parent filter is wholly pushed down through the join, the join will become= the top node, and then the `transform` method will skip the join to apply = the rule.=C2=A0 > =C2=A0 > Suppose we have two tables: table1 and table2: > table1: (a: string, b: string, c: string) > table2: (d: string) > sql as: > =C2=A0 > {code:java} > select * from table1 left join (select d, 'w1' as r from table2) on a =3D= d and r =3D 'w2' where b =3D 2{code} > =C2=A0 > let's focus on the following optimizer rules: > PushPredicateThroughJoin > FodablePropagation > BooleanSimplification > PruneFilters > =C2=A0 > In the above case, on the first iteration of these rules: > PushPredicateThroughJoin ->=C2=A0 > {code:java} > select * from table1 where b=3D2 left join (select d, 'w1' as r from tabl= e2) on a =3D d and r =3D 'w2' > {code} > FodablePropagation -> > {code:java} > select * from table1 where b=3D2 left join (select d, 'w1' as r from tabl= e2) on a =3D d and 'w1' =3D 'w2'{code} > BooleanSimplification -> > {code:java} > select * from table1 where b=3D2 left join (select d, 'w1' as r from tabl= e2) on false{code} > PruneFilters -> No effective > =C2=A0 > After several iteration of these rules, the join condition will still nev= er be pushed to the=C2=A0 > right hand of the left join. thus, in some case(e.g. Large right table), = the `BroadcastNestedLoopJoin` may be slow or oom. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org