carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kunalkap...@apache.org
Subject carbondata git commit: [CARBONDATA-3065]Correct the error message for inverted index columns and update the docment
Date Fri, 16 Nov 2018 14:42:22 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 851dd2c88 -> 0c02e9801


[CARBONDATA-3065]Correct the error message for inverted index columns and update the docment

Modified the error message when column present in Inverted index is not present in Schema
Updated the table property in user document

This closes #2924


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

Branch: refs/heads/master
Commit: 0c02e9801a9739b3f2a0eadc9c9f4157b6e52ea0
Parents: 851dd2c
Author: brijoobopanna <brijoobopanna@huawei.com>
Authored: Thu Nov 15 10:56:15 2018 +0530
Committer: kunal642 <kunalkapoor642@gmail.com>
Committed: Fri Nov 16 20:12:06 2018 +0530

----------------------------------------------------------------------
 docs/ddl-of-carbondata.md                                 |  1 +
 .../carbondata/datasource/SparkCarbonDataSourceTest.scala | 10 ++++++++++
 .../apache/carbondata/sdk/file/CarbonWriterBuilder.java   |  4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/0c02e980/docs/ddl-of-carbondata.md
----------------------------------------------------------------------
diff --git a/docs/ddl-of-carbondata.md b/docs/ddl-of-carbondata.md
index 7e7b210..89d9915 100644
--- a/docs/ddl-of-carbondata.md
+++ b/docs/ddl-of-carbondata.md
@@ -86,6 +86,7 @@ CarbonData DDL statements are documented here,which includes:
 | ------------------------------------------------------------ | ------------------------------------------------------------
|
 | [DICTIONARY_INCLUDE](#dictionary-encoding-configuration)     | Columns for which dictionary
needs to be generated           |
 | [NO_INVERTED_INDEX](#inverted-index-configuration)           | Columns to exclude from
inverted index generation            |
+| [INVERTED_INDEX](#inverted-index-configuration)              | Columns to include for inverted
index generation             |
 | [SORT_COLUMNS](#sort-columns-configuration)                  | Columns to include in sort
and its order of sort             |
 | [SORT_SCOPE](#sort-scope-configuration)                      | Sort scope of the load.Options
include no sort, local sort ,batch sort and global sort |
 | [TABLE_BLOCKSIZE](#table-block-size-configuration)           | Size of blocks to write
onto hdfs                            |

http://git-wip-us.apache.org/repos/asf/carbondata/blob/0c02e980/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceTest.scala
----------------------------------------------------------------------
diff --git a/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceTest.scala
b/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceTest.scala
index 5eb103a..c5d6a8c 100644
--- a/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceTest.scala
+++ b/integration/spark-datasource/src/test/scala/org/apache/spark/sql/carbondata/datasource/SparkCarbonDataSourceTest.scala
@@ -1345,6 +1345,15 @@ class SparkCarbonDataSourceTest extends FunSuite with BeforeAndAfterAll
{
     spark.sql("drop table if exists fileformat_drop_hive")
   }
 
+  test("validate the columns not present in schema") {
+    spark.sql("drop table if exists validate")
+    spark.sql("create table validate (name string, age int, address string) using carbon
options('inverted_index'='abc')")
+    val ex = intercept[Exception] {
+      spark.sql("insert into validate select 'abc',4,'def'")
+    }
+    assert(ex.getMessage.contains("column: abc specified in inverted index columns does not
exist in schema"))
+  }
+
   override protected def beforeAll(): Unit = {
     drop
     createParquetTable
@@ -1360,5 +1369,6 @@ class SparkCarbonDataSourceTest extends FunSuite with BeforeAndAfterAll
{
     spark.sql("drop table if exists testparquet")
     spark.sql("drop table if exists par_table")
     spark.sql("drop table if exists sdkout")
+    spark.sql("drop table if exists validate")
   }
 }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/0c02e980/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
----------------------------------------------------------------------
diff --git a/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
b/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
index d3aaf3b..917d4dc 100644
--- a/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
+++ b/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
@@ -618,8 +618,8 @@ public class CarbonWriterBuilder {
         }
       }
       if (!exists) {
-        throw new RuntimeException(
-            "column: " + invertedIdxColumn + " specified in sort columns does not exist in
schema");
+        throw new RuntimeException("column: " + invertedIdxColumn
+            + " specified in inverted index columns does not exist in schema");
       }
     }
     int i = 0;


Mime
View raw message