carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [1/2] carbondata git commit: describe formatted supported for noinvertedindex and nullpointerexception handled in compaction
Date Thu, 08 Jun 2017 17:12:19 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 7dfd19352 -> 224e38513


describe formatted supported for noinvertedindex and nullpointerexception handled in compaction


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

Branch: refs/heads/master
Commit: 14eca3dd405829d1768a55ef1213cc0a9b879971
Parents: 7dfd193
Author: rahulforallp <rahul.kumar@knoldus.in>
Authored: Wed May 31 18:22:30 2017 +0530
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Thu Jun 8 22:41:09 2017 +0530

----------------------------------------------------------------------
 .../TestNoInvertedIndexLoadAndQuery.scala       | 25 +++++++++++++++++++-
 .../execution/command/carbonTableSchema.scala   | 10 ++++++--
 .../execution/command/carbonTableSchema.scala   | 10 ++++++--
 .../carbondata/processing/store/TablePage.java  |  3 ++-
 4 files changed, 42 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/14eca3dd/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/TestNoInvertedIndexLoadAndQuery.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/TestNoInvertedIndexLoadAndQuery.scala
b/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/TestNoInvertedIndexLoadAndQuery.scala
index 702af21..ebd298a 100644
--- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/TestNoInvertedIndexLoadAndQuery.scala
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/TestNoInvertedIndexLoadAndQuery.scala
@@ -224,7 +224,7 @@ class TestNoInvertedIndexLoadAndQuery extends QueryTest with BeforeAndAfterAll
{
         """),
       Seq(Row(19.0, "Emily", "Bangalore")))
   }
-  
+
   test("no inverted index test for row level filter queries") {
     sql("""
            CREATE TABLE IF NOT EXISTS carbonNoInvertedIndexTable
@@ -261,8 +261,31 @@ class TestNoInvertedIndexLoadAndQuery extends QueryTest with BeforeAndAfterAll
{
       sql("SELECT * FROM carbonNoInvertedIndexTable WHERE city > 'Shanghai' and city <=
'Washington'"))
   }
 
+  test("no inverted index with describe formatted query") {
+    sql("drop table if exists indexFormat")
+    sql(
+      """
+           CREATE TABLE IF NOT EXISTS indexFormat
+           (id Int, name String, city String)
+           STORED BY 'org.apache.carbondata.format'
+           TBLPROPERTIES('DICTIONARY_EXCLUDE'='city','NO_INVERTED_INDEX'='city')
+      """)
+    sql(
+      s"""
+           LOAD DATA LOCAL INPATH '$testData1' into table indexFormat
+           """)
+    checkExistence(
+      sql(
+        """
+           describe formatted indexFormat
+        """),
+      true,"NOINVERTEDINDEX")
+  }
 
   override def afterAll {
+    sql("drop table if exists index1")
+    sql("drop table if exists index2")
+    sql("drop table if exists indexFormat")
     clean
   }
 

http://git-wip-us.apache.org/repos/asf/carbondata/blob/14eca3dd/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 7258511..da170c3 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
@@ -793,9 +793,15 @@ private[sql] case class DescribeCommandFormatted(
         }
         if (dimension.hasEncoding(Encoding.DICTIONARY) &&
             !dimension.hasEncoding(Encoding.DIRECT_DICTIONARY)) {
-          "DICTIONARY, KEY COLUMN"
+          "DICTIONARY, KEY COLUMN" + (dimension.hasEncoding(Encoding.INVERTED_INDEX) match
{
+                      case false => ",NOINVERTEDINDEX"
+                      case _ => ""
+                    })
         } else {
-          "KEY COLUMN"
+          "KEY COLUMN" + (dimension.hasEncoding(Encoding.INVERTED_INDEX) match {
+            case false => ",NOINVERTEDINDEX"
+            case _ => ""
+          })
         }
       } else {
         "MEASURE"

http://git-wip-us.apache.org/repos/asf/carbondata/blob/14eca3dd/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 8818c6b..08d47c2 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
@@ -824,9 +824,15 @@ private[sql] case class DescribeCommandFormatted(
         }
         if (dimension.hasEncoding(Encoding.DICTIONARY) &&
             !dimension.hasEncoding(Encoding.DIRECT_DICTIONARY)) {
-          "DICTIONARY, KEY COLUMN"
+          "DICTIONARY, KEY COLUMN" + (dimension.hasEncoding(Encoding.INVERTED_INDEX) match
{
+            case false => ",NOINVERTEDINDEX"
+            case _ => ""
+          })
         } else {
-          "KEY COLUMN"
+          "KEY COLUMN" + (dimension.hasEncoding(Encoding.INVERTED_INDEX) match {
+            case false => ",NOINVERTEDINDEX"
+            case _ => ""
+          })
         }
       } else {
         "MEASURE"

http://git-wip-us.apache.org/repos/asf/carbondata/blob/14eca3dd/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
----------------------------------------------------------------------
diff --git a/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
b/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
index cf1b746..0c02980 100644
--- a/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
+++ b/processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
@@ -121,7 +121,8 @@ class TablePage {
 
       // in compaction flow the measure with decimal type will come as Spark decimal.
       // need to convert it to byte array.
-      if (measurePage[i].getDataType() == DataType.DECIMAL && model.isCompactionFlow())
{
+      if (null != value && measurePage[i].getDataType() == DataType.DECIMAL &&
model
+          .isCompactionFlow()) {
         BigDecimal bigDecimal = ((Decimal) value).toJavaBigDecimal();
         value = DataTypeUtil.bigDecimalToByte(bigDecimal);
       }


Mime
View raw message