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 A6904200B6D for ; Tue, 9 Aug 2016 06:58:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A5249160AB3; Tue, 9 Aug 2016 04:58:38 +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 EB2F5160A91 for ; Tue, 9 Aug 2016 06:58:37 +0200 (CEST) Received: (qmail 14986 invoked by uid 500); 9 Aug 2016 04:58:37 -0000 Mailing-List: contact commits-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list commits@hawq.incubator.apache.org Received: (qmail 14977 invoked by uid 99); 9 Aug 2016 04:58:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2016 04:58:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C121EC3BE6 for ; Tue, 9 Aug 2016 04:58:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.674 X-Spam-Level: X-Spam-Status: No, score=-3.674 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.454] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id ZksahHumrtF0 for ; Tue, 9 Aug 2016 04:58:34 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 25DAD5FE5C for ; Tue, 9 Aug 2016 04:58:33 +0000 (UTC) Received: (qmail 14952 invoked by uid 99); 9 Aug 2016 04:58:33 -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; Tue, 09 Aug 2016 04:58:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3964AE03A6; Tue, 9 Aug 2016 04:58:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rlei@apache.org To: commits@hawq.incubator.apache.org Message-Id: <00d8c8d075494d11ab73bcf8cdae639c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-hawq git commit: HAWQ-990. Union clause break with distributed by clause. Date: Tue, 9 Aug 2016 04:58:33 +0000 (UTC) archived-at: Tue, 09 Aug 2016 04:58:38 -0000 Repository: incubator-hawq Updated Branches: refs/heads/master 2097cee21 -> 4bbd4a15d HAWQ-990. Union clause break with distributed by clause. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/4bbd4a15 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/4bbd4a15 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/4bbd4a15 Branch: refs/heads/master Commit: 4bbd4a15d28bdf4900620d7eab784089011747df Parents: 2097cee Author: xunzhang Authored: Tue Aug 9 12:28:45 2016 +0800 Committer: rlei Committed: Tue Aug 9 12:57:54 2016 +0800 ---------------------------------------------------------------------- src/backend/parser/analyze.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4bbd4a15/src/backend/parser/analyze.c ---------------------------------------------------------------------- diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 1f48c36..1937471 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -12235,13 +12235,11 @@ setQryDistributionPolicy(SelectStmt *stmt, Query *qry) } /*foreach */ } - if (policy->nattrs > 0) - { - policy->bucketnum = GetRelOpt_bucket_num_fromOptions(stmt->intoClause->options, GetHashDistPartitionNum()); - } - else - { - policy->bucketnum = GetRelOpt_bucket_num_fromOptions(stmt->intoClause->options, GetDefaultPartitionNum()); + List *options = stmt->intoClause != NULL ? stmt->intoClause->options : NULL; + if (policy->nattrs > 0) { + policy->bucketnum = GetRelOpt_bucket_num_fromOptions(options, GetHashDistPartitionNum()); + } else { + policy->bucketnum = GetRelOpt_bucket_num_fromOptions(options, GetDefaultPartitionNum()); } }