You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ku...@apache.org on 2018/06/20 06:44:24 UTC

[1/3] carbondata git commit: [CARBONDATA-2611] Added Test Cases for Local Dictionary Support for Create Table comand

Repository: carbondata
Updated Branches:
  refs/heads/master be20fefbe -> c5a4ec07a


http://git-wip-us.apache.org/repos/asf/carbondata/blob/c5a4ec07/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala b/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
index 65ff76d..9af8817 100644
--- a/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
+++ b/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
@@ -321,9 +321,8 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {
         case scala.util.Failure(ex) =>
           LOGGER
             .debug(
-              "invalid value is configured for local_dictionary_threshold, considering the defaut" +
-              " " +
-              "value")
+              "invalid value is configured for local_dictionary_threshold, considering the " +
+              "default value")
           tableProperties.put(CarbonCommonConstants.LOCAL_DICTIONARY_THRESHOLD,
             CarbonCommonConstants.LOCAL_DICTIONARY_THRESHOLD_DEFAULT)
       }
@@ -362,9 +361,11 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {
               .distinct.length !=
             List(localDictIncludeCols, localDictExcludeCols).mkString(",").split(",")
               .length) {
+          val duplicateColumns = localDictIncludeCols.diff(localDictExcludeCols.distinct).distinct
           val errMsg =
-            "Column ambiguity as duplicate columns present in LOCAL_DICTIONARY_INCLUDE and " +
-            "LOCAL_DICTIONARY_INCLUDE.Duplicate columns are not allowed."
+            "Column ambiguity as duplicate column(s):  " +
+            duplicateColumns.mkString("(", ",", ")") + "are present in LOCAL_DICTIONARY_INCLUDE " +
+            "and LOCAL_DICTIONARY_EXCLUDE. Duplicate columns are not allowed."
           throw new MalformedCarbonCommandException(errMsg)
         }
       }
@@ -411,10 +412,11 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {
 
     // check if the duplicate columns are specified in table schema
     if (localDictColumns.distinct.lengthCompare(localDictColumns.size) != 0) {
-      val a = localDictColumns.diff(localDictColumns.distinct).distinct
-      val errMsg = "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE contains Duplicate Columns " +
-                   a.mkString("(", ",", ")") +
-                   ". Please check create table statement."
+      val duplicateColumns = localDictColumns.diff(localDictColumns.distinct).distinct
+      val errMsg =
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE contains Duplicate Columns: " +
+        duplicateColumns.mkString("(", ",", ")") +
+        ". Please check create table statement."
       throw new MalformedCarbonCommandException(errMsg)
     }
 
@@ -436,8 +438,9 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {
                      !x.dataType.get.equalsIgnoreCase("ARRAY"))) {
         val errormsg = "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: " +
                        dictColm.trim +
-                       " is not a String datatype column. LOCAL_DICTIONARY_COLUMN should be no " +
-                       "dictionary string datatype column.Please check create table statement."
+                       " is not a String/complex datatype column. LOCAL_DICTIONARY_COLUMN should " +
+                       "be no dictionary string/complex datatype column.Please check create table" +
+                       " statement."
         throw new MalformedCarbonCommandException(errormsg)
       }
     }
@@ -448,10 +451,12 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {
         tableProperties(CarbonCommonConstants.DICTIONARY_INCLUDE).split(",").map(_.trim)
       localDictColumns.foreach { distCol =>
         if (dictIncludeColumns.exists(x => x.equalsIgnoreCase(distCol.trim))) {
+          val duplicateColumns = dictIncludeColumns.diff(localDictColumns.distinct).distinct
           val errormsg = "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: " +
-                         distCol.trim +
+                         duplicateColumns.mkString("(", ",", ")") +
                          " specified in Dictionary include. Local Dictionary will not be " +
-                         "generated for Dictionary include. Please check create table statement."
+                         "generated for Dictionary include columns. Please check create table " +
+                         "statement."
           throw new MalformedCarbonCommandException(errormsg)
         }
       }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/c5a4ec07/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 c6bd567..3b56a35 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
@@ -141,7 +141,7 @@ private[sql] case class CarbonDescribeFormattedCommand(
      */
     def getDictColumnString(localDictColumns: Array[String]): String = {
       val dictColumns: StringBuilder = new StringBuilder
-      localDictColumns.foreach(column => dictColumns.append(column).append(","))
+      localDictColumns.foreach(column => dictColumns.append(column.trim).append(","))
       dictColumns.toString().patch(dictColumns.toString().lastIndexOf(","), "", 1)
     }
 


[3/3] carbondata git commit: [CARBONDATA-2611] Added Test Cases for Local Dictionary Support for Create Table comand

Posted by ku...@apache.org.
[CARBONDATA-2611] Added Test Cases for Local Dictionary Support for Create Table comand

What changes were proposed in this pull request?
In this PR, UTs and SDV test cases are added for local dictionary support for create table command and describe formatted command.

changed the error message for validation of local dictionary table properties and
fixed column name display without extra space in describe formatted command

This closes#2377


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

Branch: refs/heads/master
Commit: c5a4ec07a8c03600741d6a2ae324a4fe4ab61659
Parents: be20fef
Author: praveenmeenakshi56 <pr...@gmail.com>
Authored: Thu Jun 14 23:36:59 2018 +0530
Committer: kumarvishal09 <ku...@gmail.com>
Committed: Wed Jun 20 12:13:09 2018 +0530

----------------------------------------------------------------------
 ...CreateTableWithLocalDictionaryTestCase.scala | 2102 ++++++++++++++++++
 .../cluster/sdv/suite/SDVSuites.scala           |    6 +-
 .../LocalDictionarySupportCreateTableTest.scala | 2102 ++++++++++++++++++
 .../spark/sql/catalyst/CarbonDDLSqlParser.scala |   31 +-
 .../table/CarbonDescribeFormattedCommand.scala  |    2 +-
 5 files changed, 4227 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/c5a4ec07/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/CreateTableWithLocalDictionaryTestCase.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/CreateTableWithLocalDictionaryTestCase.scala b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/CreateTableWithLocalDictionaryTestCase.scala
new file mode 100644
index 0000000..48a31b7
--- /dev/null
+++ b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/CreateTableWithLocalDictionaryTestCase.scala
@@ -0,0 +1,2102 @@
+package org.apache.carbondata.cluster.sdv.generated
+
+import org.apache.spark.sql.test.util.QueryTest
+import org.scalatest.BeforeAndAfterAll
+
+import org.apache.carbondata.common.exceptions.sql.MalformedCarbonCommandException
+
+class CreateTableWithLocalDictionaryTestCase extends QueryTest with BeforeAndAfterAll {
+
+  override protected def beforeAll(): Unit = {
+    sql("DROP TABLE IF EXISTS LOCAL1")
+  }
+
+  test("test local dictionary default configuration") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict columns _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations for local dict columns _002")
+  {
+    sql("drop table if exists local1")
+
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict columns _003") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+  }
+
+  test("test local dictionary custom configurations for local dict columns _004") {
+    sql("drop table if exists local1")
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='abc')
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test local dictionary custom configurations for local dict columns _005") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='id')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test local dictionary custom configurations for local dict columns _006") {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('dictionary_include'='name','local_dictionary_include'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='10000')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='-100')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='21474874811')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _005")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='-100','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='vdslv','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_005")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_006")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'=' ')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_007")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='hello')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_008")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='name',
+          | 'dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_009")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='','local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_010")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='-100','local_dictionary_include'='Hello')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_011")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='23213497321591234324',
+          | 'local_dictionary_include'='name','dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary default configuration when enabled") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='true')
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name','local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _002")
+  {
+    sql("drop table if exists local1")
+
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _003") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _004") {
+    sql("drop table if exists local1")
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='abc')
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _005") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='id')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _006") {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_include'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _002")
+  {
+    sql("drop table if exists local1")
+
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _003") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _004") {
+    sql("drop table if exists local1")
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='abc')
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _005") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='id')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _006") {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_exclude'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+
+    val descFormatted1 = sql("describe formatted local1").collect
+
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _002") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int,add string)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city','sort_columns'='add',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+
+    val descFormatted1 = sql("describe formatted local1").collect
+
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='false')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Include")
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Exclude")
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _004")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+          | 'local_dictionary_enable'='true','dictionary_include'='name,city')
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _005")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,city',
+          | 'local_dictionary_exclude'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _006")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int,st struct<s_id:int,
+        | s_name:string,s_city:array<string>>)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city,st',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city,st"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _007")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int,st array<struct<s_id:int,
+        | s_name:string>>)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city,st',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city,st"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='21474874811')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _005")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='vdslv',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _005")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _006")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'=' ')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _007")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'='hello')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _008")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'='name','dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _009")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='',
+          | 'local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _010")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100',
+          | 'local_dictionary_include'='Hello')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _011")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true',
+          | 'local_dictionary_threshold'='23213497321591234324','local_dictionary_include'='name',
+          | 'dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary default configuration when disabled") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name','local_dictionary_enable'='false')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='name,name')
+      """.stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _003") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _004") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='abc')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _005") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='id')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _006") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','dictionary_include'='name',
+        | 'local_dictionary_include'='name')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='-100')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='21474874811')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _005")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='-100',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='vdslv',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _005")
+  {
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name,name')
+      """.stripMargin)
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _006")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'=' ')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _007")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _008")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name','dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _009")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='',
+        | 'local_dictionary_include'='name,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _010")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='-100',
+        | 'local_dictionary_include'='Hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _011")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false',
+        | 'local_dictionary_threshold'='23213497321591234324','local_dictionary_include'='name',
+        | 'dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configuration with other table properties _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='global_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("global_sort"))
+    }
+  }
+
+  test("test local dictionary custom configuration with other table properties _002") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='batch_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("batch_sort"))
+    }
+  }
+  test("test local dictionary custom configuration with other table properties _003") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='no_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("no_sort"))
+    }
+  }
+  test("test local dictionary custom configuration with other table properties _004") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='local_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("local_sort"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary default configuration when enabled") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | create table local1 stored by 'carbondata' tblproperties('local_dictionary_enable'='true') as
+        | select * from local
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _001") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name','local_dictionary_enable'='true')
+        | as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _002")
+  {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,name')
+          | as select * from local
+        """.stripMargin)
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _003") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _004") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='abc')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _005") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='id')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _006") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_include'='name') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _001") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_enable'='true')
+        | as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _002")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='name,name')
+          | as select * from local
+        """.stripMargin)
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _003") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _004") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='abc')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _005") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='id')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _006") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_exclude'='name') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _001")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='true') as select * from local
+      """.
+        stripMargin)
+
+    val descFormatted1 = sql("describe formatted local1").collect
+
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _002")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='false') as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Include")
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Exclude")
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _003")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+          | 'local_dictionary_enable'='true','dictionary_include'='name,city') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _004")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,city',
+          | 'local_dictionary_exclude'='name') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _005")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int,st struct<s_id:int,
+        | s_name:string,s_city:array<string>>)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='true')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city,st',
+        | 'local_dictionary_enable'='false') as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='23589714365172595')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when first table is hive table")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        |  tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000','local_dictionary_include'='city')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  test("test no inverted index for local dictionary custom configurations when first table is hive table")
+  {
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='true',
+        | 'local_dictionary_threshold'='10000','local_dictionary_include'='city','no_inverted_index'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  override protected def afterAll(): Unit = {
+    sql("DROP TABLE IF EXISTS LOCAL1")
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/c5a4ec07/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/suite/SDVSuites.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/suite/SDVSuites.scala b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/suite/SDVSuites.scala
index c5aceaa..6756468 100644
--- a/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/suite/SDVSuites.scala
+++ b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/suite/SDVSuites.scala
@@ -62,7 +62,8 @@ class SDVSuites extends Suites with BeforeAndAfterAll {
                               new PreAggregateTestCase ::
                               new TimeSeriesPreAggregateTestCase ::
                               new TestPartitionWithGlobalSort ::
-                              new PartitionWithPreAggregateTestCase :: Nil
+                              new PartitionWithPreAggregateTestCase ::
+                              new CreateTableWithLocalDictionaryTestCase :: Nil
 
   override val nestedSuites = suites.toIndexedSeq
 
@@ -152,7 +153,8 @@ class SDVSuites3 extends Suites with BeforeAndAfterAll {
                     new TestPartitionWithGlobalSort ::
                     new SDKwriterTestCase ::
                     new SetParameterTestCase ::
-                    new PartitionWithPreAggregateTestCase :: Nil
+                    new PartitionWithPreAggregateTestCase ::
+                    new CreateTableWithLocalDictionaryTestCase :: Nil
 
   override val nestedSuites = suites.toIndexedSeq
 


[2/3] carbondata git commit: [CARBONDATA-2611] Added Test Cases for Local Dictionary Support for Create Table comand

Posted by ku...@apache.org.
http://git-wip-us.apache.org/repos/asf/carbondata/blob/c5a4ec07/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/localdictionary/LocalDictionarySupportCreateTableTest.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/localdictionary/LocalDictionarySupportCreateTableTest.scala b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/localdictionary/LocalDictionarySupportCreateTableTest.scala
new file mode 100644
index 0000000..5f9af69
--- /dev/null
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/localdictionary/LocalDictionarySupportCreateTableTest.scala
@@ -0,0 +1,2102 @@
+package org.apache.carbondata.spark.testsuite.localdictionary
+
+import org.apache.spark.sql.test.util.QueryTest
+import org.scalatest.BeforeAndAfterAll
+
+import org.apache.carbondata.common.exceptions.sql.MalformedCarbonCommandException
+
+class LocalDictionarySupportCreateTableTest extends QueryTest with BeforeAndAfterAll {
+
+  override protected def beforeAll(): Unit = {
+    sql("DROP TABLE IF EXISTS LOCAL1")
+  }
+
+  test("test local dictionary default configuration") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict columns _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations for local dict columns _002")
+  {
+    sql("drop table if exists local1")
+
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict columns _003") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+  }
+
+  test("test local dictionary custom configurations for local dict columns _004") {
+    sql("drop table if exists local1")
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='abc')
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test local dictionary custom configurations for local dict columns _005") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_include'='id')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test local dictionary custom configurations for local dict columns _006") {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('dictionary_include'='name','local_dictionary_include'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='10000')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='-100')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='21474874811')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations for local dict threshold _005")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='-100','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_threshold'='vdslv','local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_005")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_006")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'=' ')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_007")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='hello')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_008")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='10000','local_dictionary_include'='name',
+          | 'dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_009")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='','local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_010")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='-100','local_dictionary_include'='Hello')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations with both columns and threshold configured " +
+       "_011")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_threshold'='23213497321591234324',
+          | 'local_dictionary_include'='name','dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary default configuration when enabled") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='true')
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name','local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _002")
+  {
+    sql("drop table if exists local1")
+
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _003") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _004") {
+    sql("drop table if exists local1")
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='abc')
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _005") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='id')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict columns _006") {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_include'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _002")
+  {
+    sql("drop table if exists local1")
+
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _003") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _004") {
+    sql("drop table if exists local1")
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='abc')
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _005") {
+    sql("drop table if exists local1")
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='id')
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test local dictionary custom configurations when local_dictionary_exclude is configured _006") {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_exclude'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+
+    val descFormatted1 = sql("describe formatted local1").collect
+
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _002") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int,add string)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city','sort_columns'='add',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+
+        val descFormatted1 = sql("describe formatted local1").collect
+
+        descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+          case Some(row) => assert(row.get(1).toString.contains("true"))
+        }
+        descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+          case Some(row) => assert(row.get(1).toString.contains("name"))
+        }
+        descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+          case Some(row) => assert(row.get(1).toString.contains("city"))
+        }
+      }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='false')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Include")
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Exclude")
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _004")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+          | 'local_dictionary_enable'='true','dictionary_include'='name,city')
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _005")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,city',
+          | 'local_dictionary_exclude'='name')
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _006")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int,st struct<s_id:int,
+        | s_name:string,s_city:array<string>>)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city,st',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city,st"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _007")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int,st array<struct<s_id:int,
+        | s_name:string>>)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city,st',
+        | 'local_dictionary_enable'='true')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city,st"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='21474874811')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test local dictionary custom configurations when enabled for local dict threshold _005")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='vdslv',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    sql("desc formatted local1").show(truncate = false)
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _005")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _006")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'=' ')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _007")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'='hello')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _008")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000',
+          | 'local_dictionary_include'='name','dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _009")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='',
+          | 'local_dictionary_include'='name,name')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _010")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100',
+          | 'local_dictionary_include'='Hello')
+        """.stripMargin)
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when enabled with both columns and threshold " +
+    "configured _011")
+  {
+    sql("drop table if exists local1")
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1(id int, name string, city string, age int)
+          | STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true',
+          | 'local_dictionary_threshold'='23213497321591234324','local_dictionary_include'='name',
+          | 'dictionary_include'='name')
+        """.stripMargin)
+    }
+  }
+
+  test("test local dictionary default configuration when disabled") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name','local_dictionary_enable'='false')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='name,name')
+      """.stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _003") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _004") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='abc')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _005") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_include'='id')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict columns _006") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','dictionary_include'='name',
+        | 'local_dictionary_include'='name')
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='-100')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='21474874811')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configurations when disabled for local dict threshold _005")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _001")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _002")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='-100',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _003")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _004")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='vdslv',
+        | 'local_dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _005")
+  {
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name,name')
+      """.stripMargin)
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _006")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'=' ')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _007")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _008")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='10000',
+        | 'local_dictionary_include'='name','dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _009")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='',
+        | 'local_dictionary_include'='name,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _010")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false','local_dictionary_threshold'='-100',
+        | 'local_dictionary_include'='Hello')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test(
+    "test local dictionary custom configurations when disabled with both columns and threshold " +
+    "configured _011")
+  {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='false',
+        | 'local_dictionary_threshold'='23213497321591234324','local_dictionary_include'='name',
+        | 'dictionary_include'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test local dictionary custom configuration with other table properties _001") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='global_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("global_sort"))
+    }
+  }
+
+  test("test local dictionary custom configuration with other table properties _002") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='batch_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("batch_sort"))
+    }
+  }
+  test("test local dictionary custom configuration with other table properties _003") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='no_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("no_sort"))
+    }
+  }
+  test("test local dictionary custom configuration with other table properties _004") {
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format'
+        | tblproperties('dictionary_include'='city','sort_scope'='local_sort',
+        | 'sort_columns'='city,name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("SORT_SCOPE")) match {
+      case Some(row) => assert(row.get(1).toString.contains("local_sort"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary default configuration when enabled") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | create table local1 stored by 'carbondata' tblproperties('local_dictionary_enable'='true') as
+        | select * from local
+      """.stripMargin)
+
+    val desc_result = sql("describe formatted local1")
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _001") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_include'='name','local_dictionary_enable'='true')
+        | as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _002")
+  {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,name')
+          | as select * from local
+        """.stripMargin)
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _003") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _004") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='abc')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _005") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='id')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict columns _006") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_include'='name') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _001") {
+    sql("drop table if exists local")
+    sql("drop table if exists local1")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_enable'='true')
+        | as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _002")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='name,name')
+          | as select * from local
+        """.stripMargin)
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _003") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column:  does not exist in table. Please check " +
+        "create table statement"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _004") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception1 = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='abc')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception1.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: abc does not exist in table. Please check " +
+        "create table " +
+        "statement"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _005") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    val exception = intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_exclude'='id')
+          | as select * from local
+        """.
+          stripMargin)
+    }
+    assert(exception.getMessage
+      .contains(
+        "LOCAL_DICTIONARY_INCLUDE/LOCAL_DICTIONARY_EXCLUDE column: id is not a String/complex datatype column. " +
+        "LOCAL_DICTIONARY_COLUMN should " +
+        "be no dictionary string/complex datatype column"))
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when local_dictionary_exclude is configured _006") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','dictionary_include'='name',
+          | 'local_dictionary_exclude'='name') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _001")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='true') as select * from local
+      """.
+        stripMargin)
+
+    val descFormatted1 = sql("describe formatted local1").collect
+
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Exclude")) match {
+      case Some(row) => assert(row.get(1).toString.contains("name"))
+    }
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _002")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+        | 'local_dictionary_enable'='false') as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Include")
+    checkExistence(sql("describe formatted local1"), false, "Local Dictionary Exclude")
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _003")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city',
+          | 'local_dictionary_enable'='true','dictionary_include'='name,city') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _004")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    intercept[MalformedCarbonCommandException] {
+      sql(
+        """
+          | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+          | tblproperties('local_dictionary_enable'='true','local_dictionary_include'='name,city',
+          | 'local_dictionary_exclude'='name') as select * from local
+        """.
+          stripMargin)
+    }
+  }
+
+  test(
+    "test CTAS statements for local dictionary custom configurations when local_dictionary_include and local_dictionary_exclude " +
+    "is configured _005")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int,st struct<s_id:int,
+        | s_name:string,s_city:array<string>>)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='true')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_exclude'='name','local_dictionary_include'='city,st',
+        | 'local_dictionary_enable'='false') as select * from local
+      """.
+        stripMargin)
+    val descFormatted1 = sql("describe formatted local1").collect
+    descFormatted1.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("false"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict threshold _001") {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("10000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict threshold _002")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='-100')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when enabled for local dict threshold _003")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='23589714365172595')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+  }
+
+  test("test CTAS statements for local dictionary custom configurations when first table is hive table")
+  {
+    sql("drop table if exists local1")
+    sql("drop table if exists local")
+    sql(
+      """
+        | CREATE TABLE local(id int, name string, city string, age int)
+        |  tblproperties('local_dictionary_enable'='false')
+      """.stripMargin)
+    sql(
+      """
+        | CREATE TABLE local1 STORED BY 'org.apache.carbondata.format'
+        | tblproperties('local_dictionary_enable'='true','local_dictionary_threshold'='10000','local_dictionary_include'='city')
+        | as select * from local
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  test("test no inverted index for local dictionary custom configurations")
+  {
+    sql("drop table if exists local1")
+
+    sql(
+      """
+        | CREATE TABLE local1(id int, name string, city string, age int)
+        | STORED BY 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='true',
+        | 'local_dictionary_threshold'='10000','local_dictionary_include'='city','no_inverted_index'='name')
+      """.stripMargin)
+
+    val descLoc = sql("describe formatted local1").collect
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) match {
+      case Some(row) => assert(row.get(1).toString.contains("1000"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) match {
+      case Some(row) => assert(row.get(1).toString.contains("true"))
+    }
+    descLoc.find(_.get(0).toString.contains("Local Dictionary Include")) match {
+      case Some(row) => assert(row.get(1).toString.contains("city"))
+    }
+  }
+
+  override protected def afterAll(): Unit = {
+    sql("DROP TABLE IF EXISTS LOCAL1")
+  }
+}