Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 27081200D5B for ; Wed, 13 Dec 2017 08:27:18 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 25783160C23; Wed, 13 Dec 2017 07:27:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6491A160C16 for ; Wed, 13 Dec 2017 08:27:17 +0100 (CET) Received: (qmail 17419 invoked by uid 500); 13 Dec 2017 07:27:16 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 17408 invoked by uid 99); 13 Dec 2017 07:27:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2017 07:27:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 38A4EE38B8; Wed, 13 Dec 2017 07:27:16 +0000 (UTC) From: gatorsmile To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #19257: [SPARK-22042] [SQL] ReorderJoinPredicates can bre... Content-Type: text/plain Message-Id: <20171213072716.38A4EE38B8@git1-us-west.apache.org> Date: Wed, 13 Dec 2017 07:27:16 +0000 (UTC) archived-at: Wed, 13 Dec 2017 07:27:18 -0000 Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/19257#discussion_r156579889 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala --- @@ -248,13 +252,83 @@ case class EnsureRequirements(conf: SQLConf) extends Rule[SparkPlan] { operator.withNewChildren(children) } + /** + * When the physical operators are created for JOIN, the ordering of join keys is based on order + * in which the join keys appear in the user query. That might not match with the output + * partitioning of the join node's children (thus leading to extra sort / shuffle being + * introduced). This rule will change the ordering of the join keys to match with the + * partitioning of the join nodes' children. + */ + def reorderJoinPredicates(plan: SparkPlan): SparkPlan = { --- End diff -- private --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org