You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ja...@apache.org on 2018/07/24 06:37:25 UTC
carbondata git commit: [CARBONDATA-2694][32k] Show longstring table
property in descformatted
Repository: carbondata
Updated Branches:
refs/heads/master e5c1568de -> 42a80564c
[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/42a80564
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/42a80564
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/42a80564
Branch: refs/heads/master
Commit: 42a80564c6669b56da5c1e41c186b12f543697de
Parents: e5c1568
Author: xuchuanyin <xu...@hust.edu.cn>
Authored: Fri Jul 6 12:09:23 2018 +0800
Committer: Jacky Li <ja...@qq.com>
Committed: Tue Jul 24 14:37:05 2018 +0800
----------------------------------------------------------------------
.../longstring/VarcharDataTypesBasicTestCase.scala | 12 ++++++++++++
.../command/table/CarbonDescribeFormattedCommand.scala | 7 +++++++
2 files changed, 19 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/carbondata/blob/42a80564/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/42a80564/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)