carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [23/50] carbondata git commit: [CARBONDATA-2694][32k] Show longstring table property in descformatted
Date Mon, 30 Jul 2018 18:42:49 GMT
[CARBONDATA-2694][32k] Show longstring table property in descformatted

add longstring table property in the output of desc formantted command

This closes #2456


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

Branch: refs/heads/branch-1.4
Commit: c18f6120310f9823a4a60280456c6332c81aaf61
Parents: d8a4681
Author: xuchuanyin <xuchuanyin@hust.edu.cn>
Authored: Fri Jul 6 12:09:23 2018 +0800
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Tue Jul 31 00:11:26 2018 +0530

----------------------------------------------------------------------
 .../longstring/VarcharDataTypesBasicTestCase.scala      | 12 ++++++++++++
 .../command/table/CarbonDescribeFormattedCommand.scala  |  7 +++++++
 2 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/c18f6120/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/longstring/VarcharDataTypesBasicTestCase.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/longstring/VarcharDataTypesBasicTestCase.scala
b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/longstring/VarcharDataTypesBasicTestCase.scala
index 4b8187f..4aa7062 100644
--- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/longstring/VarcharDataTypesBasicTestCase.scala
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/longstring/VarcharDataTypesBasicTestCase.scala
@@ -372,6 +372,18 @@ class VarcharDataTypesBasicTestCase extends QueryTest with BeforeAndAfterEach
wi
     checkQuery()
   }
 
+  test("desc table shows long_string_columns property") {
+    sql(
+      s"""
+         | CREATE TABLE if not exists $longStringTable(
+         | id INT, name STRING, description STRING, address STRING, note STRING
+         | ) STORED BY 'carbondata'
+         | TBLPROPERTIES('LONG_STRING_COLUMNS'='address, note', 'dictionary_include'='name',
'sort_columns'='id')
+         |""".
+        stripMargin)
+    checkExistence(sql(s"desc formatted $longStringTable"), true, "long_string_columns".toUpperCase,
"address", "note")
+  }
+
   // will create 2 long string columns
   private def createFile(filePath: String, line: Int = 10000, start: Int = 0,
       varcharLen: Int = Short.MaxValue + 1000): Content = {

http://git-wip-us.apache.org/repos/asf/carbondata/blob/c18f6120/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 cdd9b36..9e1e0e4 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
@@ -115,6 +115,13 @@ private[sql] case class CarbonDescribeFormattedCommand(
       CarbonCommonConstants.CACHE_LEVEL_DEFAULT_VALUE), ""))
     val isStreaming = tblProps.asScala.getOrElse("streaming", "false")
     results ++= Seq(("Streaming", isStreaming, ""))
+
+    // longstring related info
+    if (tblProps.containsKey(CarbonCommonConstants.LONG_STRING_COLUMNS)) {
+      results ++= Seq((CarbonCommonConstants.LONG_STRING_COLUMNS.toUpperCase,
+        tblProps.get(CarbonCommonConstants.LONG_STRING_COLUMNS), ""))
+    }
+
     var isLocalDictEnabled = tblProps.asScala
       .getOrElse(CarbonCommonConstants.LOCAL_DICTIONARY_ENABLE,
         CarbonCommonConstants.LOCAL_DICTIONARY_ENABLE_DEFAULT)


Mime
View raw message