carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject [1/2] incubator-carbondata git commit: measure can not use columnDict
Date Mon, 29 Aug 2016 14:49:17 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master e87a40093 -> 9bd37eae8


measure can not use columnDict


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

Branch: refs/heads/master
Commit: aa965afc9277eaf8e3b5aad4cf2b80ac63a47447
Parents: e87a400
Author: Jay357089 <liujunjie9@huawei.com>
Authored: Wed Aug 24 10:08:01 2016 +0800
Committer: chenliang613 <chenliang613@apache.org>
Committed: Mon Aug 29 22:48:15 2016 +0800

----------------------------------------------------------------------
 .../spark/util/GlobalDictionaryUtil.scala          |  7 ++++---
 .../util/ExternalColumnDictionaryTestCase.scala    | 17 +++++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/aa965afc/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 78616c2..c894594 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
@@ -489,9 +489,10 @@ object GlobalDictionaryUtil extends Logging {
     val preDictDimensionOption = dimensions.filter(
       _.getColName.equalsIgnoreCase(dimParent))
     if (preDictDimensionOption.length == 0) {
-      logError(s"No column $dimParent exists in ${table.getDatabaseName}.${table.getTableName}")
-      throw new DataLoadingException(s"No column $colName exists " +
-      s"in ${table.getDatabaseName}.${table.getTableName}")
+      logError(s"Column $dimParent is not a key column " +
+        s"in ${table.getDatabaseName}.${table.getTableName}")
+      throw new DataLoadingException(s"Column $dimParent is not a key column. " +
+        s"Only key column can be part of dictionary and used in COLUMNDICT option.")
     }
     val preDictDimension = preDictDimensionOption(0)
     if (preDictDimension.isComplex) {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/aa965afc/integration/spark/src/test/scala/org/apache/carbondata/spark/util/ExternalColumnDictionaryTestCase.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/test/scala/org/apache/carbondata/spark/util/ExternalColumnDictionaryTestCase.scala
b/integration/spark/src/test/scala/org/apache/carbondata/spark/util/ExternalColumnDictionaryTestCase.scala
index 459b99c..a2685b1 100644
--- a/integration/spark/src/test/scala/org/apache/carbondata/spark/util/ExternalColumnDictionaryTestCase.scala
+++ b/integration/spark/src/test/scala/org/apache/carbondata/spark/util/ExternalColumnDictionaryTestCase.scala
@@ -21,6 +21,7 @@ package org.apache.carbondata.spark.util
 import java.io.File
 
 import org.apache.carbondata.core.carbon.CarbonDataLoadSchema
+import org.apache.carbondata.processing.etl.DataLoadingException
 import org.apache.carbondata.spark.exception.MalformedCarbonCommandException
 import org.apache.carbondata.spark.load.CarbonLoadModel
 import org.apache.spark.sql.{CarbonEnv, CarbonRelation}
@@ -216,6 +217,22 @@ class ExternalColumnDictionaryTestCase extends QueryTest with BeforeAndAfterAll
       case ex: MalformedCarbonCommandException =>
         assertResult(ex.getMessage)("Error: COLUMNDICT and ALL_DICTIONARY_PATH can not be
used together " +
           "in options")
+      case _ => assert(false)
+    }
+  }
+
+  test("Measure can not use COLUMNDICT") {
+    try {
+      sql(s"""
+      LOAD DATA LOCAL INPATH "$complexFilePath1" INTO TABLE loadSqlTest
+      OPTIONS('COLUMNDICT'='gamePointId:$filePath')
+      """)
+      assert(false)
+    } catch {
+      case ex: DataLoadingException =>
+        assertResult(ex.getMessage)("Column gamePointId is not a key column. Only key column
can be part " +
+          "of dictionary and used in COLUMNDICT option.")
+      case _ => assert(false)
     }
   }
 


Mime
View raw message