You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ja...@apache.org on 2018/08/29 06:34:53 UTC

carbondata git commit: [CARBONDATA-2862][DataMap] Fix exception message for datamap rebuild command

Repository: carbondata
Updated Branches:
  refs/heads/master 2a9604cd8 -> 4df5f2f1b


[CARBONDATA-2862][DataMap] Fix exception message for datamap rebuild command

Since datamap rebuild command support execute without specify table name, and it will scan all datamap instead, so error message has no need to get table name, else will get exception. This PR modify the error message to show detail table name on demand.

This closes #2640


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/4df5f2f1
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/4df5f2f1
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/4df5f2f1

Branch: refs/heads/master
Commit: 4df5f2f1b0ceb624945846875489fdf7fb9e54c7
Parents: 2a9604c
Author: Manhua <ke...@qq.com>
Authored: Thu Aug 16 11:07:08 2018 +0800
Committer: Jacky Li <ja...@qq.com>
Committed: Wed Aug 29 14:34:35 2018 +0800

----------------------------------------------------------------------
 .../command/datamap/CarbonDataMapRebuildCommand.scala       | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/4df5f2f1/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDataMapRebuildCommand.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDataMapRebuildCommand.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDataMapRebuildCommand.scala
index 0c85fe1..be62ce4 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDataMapRebuildCommand.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDataMapRebuildCommand.scala
@@ -41,8 +41,13 @@ case class CarbonDataMapRebuildCommand(
       .asScala
       .find(p => p.getDataMapName.equalsIgnoreCase(dataMapName))
     if (schemaOption.isEmpty) {
-      throw new MalformedDataMapCommandException(
-        s"Datamap with name $dataMapName does not exist on table ${tableIdentifier.get.table}")
+      if (tableIdentifier.isDefined) {
+        throw new MalformedDataMapCommandException(
+          s"Datamap with name $dataMapName does not exist on table ${tableIdentifier.get.table}")
+      } else {
+        throw new MalformedDataMapCommandException(
+          s"Datamap with name $dataMapName does not exist on any table")
+      }
     }
     val schema = schemaOption.get
     if (!schema.isLazy) {