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 06D3A200BCF for ; Mon, 5 Dec 2016 09:31:20 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0583A160B17; Mon, 5 Dec 2016 08:31:20 +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 4D82B160AF9 for ; Mon, 5 Dec 2016 09:31:19 +0100 (CET) Received: (qmail 49494 invoked by uid 500); 5 Dec 2016 08:31:18 -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 49485 invoked by uid 99); 5 Dec 2016 08:31:18 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2016 08:31:18 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E2A8F1AAE08 for ; Mon, 5 Dec 2016 08:31:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.117 X-Spam-Level: X-Spam-Status: No, score=-5.117 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=-2.999, TRACKER_ID=1.102] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id PCd2P_u5YBca for ; Mon, 5 Dec 2016 08:31:16 +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 3E7955FB36 for ; Mon, 5 Dec 2016 08:31:10 +0000 (UTC) Received: (qmail 49381 invoked by uid 99); 5 Dec 2016 08:31:09 -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; Mon, 05 Dec 2016 08:31:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3EE2BE076F; Mon, 5 Dec 2016 08:31:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jackylk@apache.org To: commits@carbondata.incubator.apache.org Date: Mon, 05 Dec 2016 08:31:09 -0000 Message-Id: <8fded40cd2fc4a29afbb05351c83c713@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-carbondata git commit: fixInsertIntoFromEmptyTable archived-at: Mon, 05 Dec 2016 08:31:20 -0000 Repository: incubator-carbondata Updated Branches: refs/heads/master bfeb573dc -> 8a6733041 fixInsertIntoFromEmptyTable Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/a62b99bd Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/a62b99bd Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/a62b99bd Branch: refs/heads/master Commit: a62b99bd9293da9535b9ccfb532ee576c738e71c Parents: bfeb573 Author: QiangCai Authored: Mon Dec 5 15:08:39 2016 +0800 Committer: QiangCai Committed: Mon Dec 5 15:08:39 2016 +0800 ---------------------------------------------------------------------- .../spark/sql/execution/command/carbonTableSchema.scala | 7 +++++++ .../spark/sql/execution/command/carbonTableSchema.scala | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/a62b99bd/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala ---------------------------------------------------------------------- diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala index 1b939f7..20bb4a3 100644 --- a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala +++ b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala @@ -367,6 +367,13 @@ case class LoadTable( def run(sqlContext: SQLContext): Seq[Row] = { + if (dataFrame.isDefined) { + val rdd = dataFrame.get.rdd + if (rdd.partitions == null || rdd.partitions.length == 0) { + LOGGER.warn("DataLoading finished. No data was loaded.") + return Seq.empty + } + } val dbName = getDB.getDatabaseName(databaseNameOp, sqlContext) if (isOverwriteExist) { http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/a62b99bd/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala ---------------------------------------------------------------------- diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala index 52fc097..f94e396 100644 --- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala +++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala @@ -293,8 +293,14 @@ case class LoadTable( val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName) - def run(sparkSession: SparkSession): Seq[Row] = { + if (dataFrame.isDefined) { + val rdd = dataFrame.get.rdd + if (rdd.partitions == null || rdd.partitions.length == 0) { + LOGGER.warn("DataLoading finished. No data was loaded.") + return Seq.empty + } + } val dbName = databaseNameOp.getOrElse(sparkSession.catalog.currentDatabase) val identifier = TableIdentifier(tableName, Option(dbName))