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-1674] Describe formatted shows partition type
Date Sat, 23 Dec 2017 13:16:31 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 1381c9f19 -> 9a2159ba6


[CARBONDATA-1674] Describe formatted shows partition type

On desc formatted command list partition should show

This closes #1689


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

Branch: refs/heads/master
Commit: 9a2159ba60b8abf3354fa8e3aa4fb7c5550e1afd
Parents: 1381c9f
Author: Jatin <jatin.demla@knoldus.in>
Authored: Fri Dec 15 10:02:12 2017 +0530
Committer: Jacky Li <jacky.likun@qq.com>
Committed: Sat Dec 23 21:16:18 2017 +0800

----------------------------------------------------------------------
 .../spark/testsuite/partition/TestShowPartitions.scala  | 12 ++++++++++--
 .../command/table/CarbonDescribeFormattedCommand.scala  |  3 +++
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/9a2159ba/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 57739d6..af3f40c 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
@@ -19,10 +19,10 @@ package org.apache.carbondata.spark.testsuite.partition
 
 import java.sql.Timestamp
 
-import org.apache.spark.sql.AnalysisException
+import org.apache.spark.sql.{AnalysisException, DataFrame, Row}
 import org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException
-import org.apache.spark.sql.Row
 import org.scalatest.BeforeAndAfterAll
+
 import org.apache.carbondata.core.constants.CarbonCommonConstants
 import org.apache.carbondata.core.util.CarbonProperties
 import org.apache.spark.sql.test.util.QueryTest
@@ -150,6 +150,14 @@ class TestShowPartition  extends QueryTest with BeforeAndAfterAll {
 
   }
 
+  test("show partition table: desc formatted should show partition type"){
+    //check for partition type exist in desc formatted
+    val result:DataFrame = sql("describe formatted hashTable")
+    checkExistence(result,true,"Partition Type")
+    val row: Array[Row] = result.collect().filter{row: Row => row.getString(0).contains("Partition
Type")}
+    assert(row(0).getString(1).contains("HASH"))
+  }
+
   test("show partition table: range partition") {
     // EqualTo
     checkAnswer(sql("show partitions rangeTable"), Seq(Row("0, doj = DEFAULT"),

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9a2159ba/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala
b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala
index ccdbd6e..5d19e0a 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDescribeFormattedCommand.scala
@@ -154,6 +154,9 @@ private[sql] case class CarbonDescribeFormattedCommand(
       results ++=
       Seq(("Partition Columns", carbonTable.getPartitionInfo(carbonTable.getTableName)
         .getColumnSchemaList.asScala.map(_.getColumnName).mkString(","), ""))
+      results ++=
+      Seq(("Partition Type", carbonTable.getPartitionInfo(carbonTable.getTableName)
+        .getPartitionType.toString, ""))
     }
     results.map {
       case (name, dataType, null) =>


Mime
View raw message