carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject carbondata git commit: [CARBONDATA-1680] Fixed Bug to show partition Ids for Hash Partition
Date Thu, 21 Dec 2017 01:04:54 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 5ed39de19 -> bc2e897cb


[CARBONDATA-1680] Fixed Bug to show partition Ids for Hash Partition

This closes #1658


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

Branch: refs/heads/master
Commit: bc2e897cbe347c9141bb9b83d90ca5aaa42da671
Parents: 5ed39de
Author: SangeetaGulia <sangeeta.gulia@knoldus.in>
Authored: Thu Dec 14 11:34:02 2017 +0530
Committer: Jacky Li <jacky.likun@qq.com>
Committed: Thu Dec 21 09:04:37 2017 +0800

----------------------------------------------------------------------
 .../spark/testsuite/partition/TestShowPartitions.scala          | 5 +++--
 .../scala/org/apache/carbondata/spark/util/CommonUtil.scala     | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/bc2e897c/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestShowPartitions.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestShowPartitions.scala
b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestShowPartitions.scala
index f455e9a..57739d6 100644
--- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestShowPartitions.scala
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestShowPartitions.scala
@@ -146,7 +146,7 @@ class TestShowPartition  extends QueryTest with BeforeAndAfterAll {
 
   test("show partition table: hash table") {
     // EqualTo
-    checkAnswer(sql("show partitions hashTable"), Seq(Row("empno = HASH_NUMBER(3)")))
+    checkAnswer(sql("show partitions hashTable"), Seq(Row("empno = HASH_NUMBER(3)"), Row("partitionIds
= [0, 1, 2]")))
 
   }
 
@@ -164,7 +164,8 @@ class TestShowPartition  extends QueryTest with BeforeAndAfterAll {
   }
   test("show partition table: not default db") {
     // EqualTo
-    checkAnswer(sql("show partitions partitionDB.hashTable"), Seq(Row("empno = HASH_NUMBER(3)")))
+    checkAnswer(sql("show partitions partitionDB.hashTable"), Seq(Row("empno = HASH_NUMBER(3)"),
+      Row("partitionIds = [0, 1, 2]")))
     // EqualTo
     checkAnswer(sql("show partitions partitionDB.rangeTable"), Seq(Row("0, doj = DEFAULT"),
       Row("1, doj < 01-01-2010"), Row("2, 01-01-2010 <= doj < 01-01-2015")))

http://git-wip-us.apache.org/repos/asf/carbondata/blob/bc2e897c/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
b/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
index d8ce8f3..c902537 100644
--- a/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
+++ b/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
@@ -691,6 +691,7 @@ object CommonUtil {
       case PartitionType.HASH =>
         val hashNumber = partitionInfo.getNumPartitions
         result.+=(RowFactory.create(columnName + " = HASH_NUMBER(" + hashNumber.toString()
+ ")"))
+        result.+=(RowFactory.create(s"partitionIds = ${partitionInfo.getPartitionIds}"))
       case others =>
         result.+=(RowFactory.create(columnName + " = "))
     }


Mime
View raw message