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 E3B7C200BB0 for ; Thu, 22 Sep 2016 07:36:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E02F9160AE2; Thu, 22 Sep 2016 05:36:08 +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 C0C27160ADE for ; Thu, 22 Sep 2016 07:36:07 +0200 (CEST) Received: (qmail 40223 invoked by uid 500); 22 Sep 2016 05:36:07 -0000 Mailing-List: contact commits-help@carbondata.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.incubator.apache.org Delivered-To: mailing list commits@carbondata.incubator.apache.org Received: (qmail 40141 invoked by uid 99); 22 Sep 2016 05:36:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Sep 2016 05:36:06 +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 4D847C5577 for ; Thu, 22 Sep 2016 05:36:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 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=-1.426] 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 Dru_TkkBpHLT for ; Thu, 22 Sep 2016 05:36:05 +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 E99EB60E5B for ; Thu, 22 Sep 2016 05:36:01 +0000 (UTC) Received: (qmail 39162 invoked by uid 99); 22 Sep 2016 05:36:00 -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; Thu, 22 Sep 2016 05:36:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 610CDE08E8; Thu, 22 Sep 2016 05:36:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ravipesala@apache.org To: commits@carbondata.incubator.apache.org Date: Thu, 22 Sep 2016 05:36:36 -0000 Message-Id: In-Reply-To: <7477a16cb2794424baceda2bf87ca3c7@git.apache.org> References: <7477a16cb2794424baceda2bf87ca3c7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [38/50] [abbrv] incubator-carbondata git commit: give a proper error message for wrong delimiter or fileheader archived-at: Thu, 22 Sep 2016 05:36:09 -0000 give a proper error message for wrong delimiter or fileheader Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/0d14af2a Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/0d14af2a Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/0d14af2a Branch: refs/heads/branch-0.1 Commit: 0d14af2a043464c408a9ff917f3c0dd6280b3b87 Parents: b2e4777 Author: QiangCai Authored: Fri Aug 26 10:57:53 2016 +0800 Committer: ravipesala Committed: Thu Sep 22 10:31:42 2016 +0530 ---------------------------------------------------------------------- .../carbondata/spark/util/GlobalDictionaryUtil.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/0d14af2a/integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala ---------------------------------------------------------------------- diff --git a/integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala b/integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala index bdd8adc..022a5f8 100644 --- a/integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala +++ b/integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala @@ -737,6 +737,12 @@ object GlobalDictionaryUtil extends Logging { generatePredefinedColDictionary(colDictFilePath, table, dimensions, carbonLoadModel, sqlContext, hdfsLocation, dictfolderPath) } + if (headers.length > df.columns.length) { + val msg = "The number of columns in the file header do not match the number of " + + "columns in the data file; Either delimiter or fileheader provided is not correct" + logError(msg) + throw new DataLoadingException(msg) + } // use fact file to generate global dict val (requireDimension, requireColumnNames) = pruneDimensions(dimensions, headers, df.columns) @@ -753,7 +759,7 @@ object GlobalDictionaryUtil extends Logging { // check result status checkStatus(carbonLoadModel, sqlContext, model, statusList) } else { - logInfo("have no column need to generate global dictionary in Fact file") + logInfo("No column found for generating global dictionary in source data files") } // generate global dict from dimension file if (carbonLoadModel.getDimFolderPath != null) { @@ -812,7 +818,7 @@ object GlobalDictionaryUtil extends Logging { } } catch { case ex: Exception => - logError("generate global dictionary failed") + logError("generate global dictionary failed", ex) throw ex } }