Return-Path: X-Original-To: apmail-hawq-commits-archive@minotaur.apache.org Delivered-To: apmail-hawq-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE2D5181F2 for ; Wed, 17 Feb 2016 02:17:21 +0000 (UTC) Received: (qmail 81949 invoked by uid 500); 17 Feb 2016 02:17:21 -0000 Delivered-To: apmail-hawq-commits-archive@hawq.apache.org Received: (qmail 81913 invoked by uid 500); 17 Feb 2016 02:17:21 -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 81904 invoked by uid 99); 17 Feb 2016 02:17:21 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2016 02:17:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 70B53C051C for ; Wed, 17 Feb 2016 02:17:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.549 X-Spam-Level: X-Spam-Status: No, score=-3.549 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.329] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id xFUqawLDsk1p for ; Wed, 17 Feb 2016 02:17:20 +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 219FA5FDEC for ; Wed, 17 Feb 2016 02:17:18 +0000 (UTC) Received: (qmail 81220 invoked by uid 99); 17 Feb 2016 02:17:18 -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, 17 Feb 2016 02:17:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1F277E0534; Wed, 17 Feb 2016 02:17:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lilima@apache.org To: commits@hawq.incubator.apache.org Date: Wed, 17 Feb 2016 02:17:18 -0000 Message-Id: <7a4de06d958142b8b4ff6034d70f9ab8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] incubator-hawq git commit: HAWQ-407. Fix memory leak in parquet metadata processing for reading table with data Repository: incubator-hawq Updated Branches: refs/heads/master 2968e5154 -> 4c3a09180 HAWQ-407. Fix memory leak in parquet metadata processing for reading table with data Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/9defbc12 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/9defbc12 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/9defbc12 Branch: refs/heads/master Commit: 9defbc12a818971b31ab402ea0935b1ff266589f Parents: 95a5da1 Author: Lili Ma Authored: Mon Feb 15 14:59:32 2016 +0800 Committer: Lili Ma Committed: Mon Feb 15 14:59:32 2016 +0800 ---------------------------------------------------------------------- src/backend/access/parquet/parquetam.c | 4 ++-- src/backend/cdb/cdbparquetfooterprocessor.c | 3 +++ src/backend/cdb/cdbparquetfooterserializer.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9defbc12/src/backend/access/parquet/parquetam.c ---------------------------------------------------------------------- diff --git a/src/backend/access/parquet/parquetam.c b/src/backend/access/parquet/parquetam.c index 67359ca..6438e32 100644 --- a/src/backend/access/parquet/parquetam.c +++ b/src/backend/access/parquet/parquetam.c @@ -583,8 +583,8 @@ ParquetInsertDesc parquet_insert_init(Relation rel, ResultRelSegFileInfo *segfil parquetInsertDesc->aoEntry = aoentry; parquetInsertDesc->insertCount = 0; - parquetInsertDesc->parquetMetadata = (struct ParquetMetadata_4C *) - palloc0(sizeof(struct ParquetMetadata_4C)); +// parquetInsertDesc->parquetMetadata = (struct ParquetMetadata_4C *) +// palloc0(sizeof(struct ParquetMetadata_4C)); /*SHOULD CALL OPEN METADATA FILE HERE, AND GET parquetMetadata INFO*/ initStringInfo(&titleBuf); http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9defbc12/src/backend/cdb/cdbparquetfooterprocessor.c ---------------------------------------------------------------------- diff --git a/src/backend/cdb/cdbparquetfooterprocessor.c b/src/backend/cdb/cdbparquetfooterprocessor.c index 510a65f..691534a 100644 --- a/src/backend/cdb/cdbparquetfooterprocessor.c +++ b/src/backend/cdb/cdbparquetfooterprocessor.c @@ -111,6 +111,9 @@ bool readParquetFooter(File fileHandler, ParquetMetadata *parquetMetadata, DetectHostEndian(); + *parquetMetadata = (struct ParquetMetadata_4C *) + palloc0(sizeof(struct ParquetMetadata_4C)); + /* if file size is 0, means there's no data in file, return false*/ if (eof == 0) return false; http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/9defbc12/src/backend/cdb/cdbparquetfooterserializer.c ---------------------------------------------------------------------- diff --git a/src/backend/cdb/cdbparquetfooterserializer.c b/src/backend/cdb/cdbparquetfooterserializer.c index 8677078..247bbb1 100644 --- a/src/backend/cdb/cdbparquetfooterserializer.c +++ b/src/backend/cdb/cdbparquetfooterserializer.c @@ -167,8 +167,8 @@ void initDeserializeFooter( initCompactProtocol(*footerProtocol, file, fileName, footerLength, PARQUET_FOOTER_BUFFERMODE_READ); - *parquetMetadata = - (struct ParquetMetadata_4C*) palloc0(sizeof(struct ParquetMetadata_4C)); +// *parquetMetadata = +// (struct ParquetMetadata_4C*) palloc0(sizeof(struct ParquetMetadata_4C)); readParquetFileMetadata(parquetMetadata, *footerProtocol); }