carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [1/2] incubator-carbondata git commit: fixInsertIntoFromEmptyTable
Date Mon, 05 Dec 2016 08:31:09 GMT
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 <qiangcai@qq.com>
Authored: Mon Dec 5 15:08:39 2016 +0800
Committer: QiangCai <qiangcai@qq.com>
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))


Mime
View raw message