Skip to content

Commit

Permalink
Merge c0813d2 into 1241fee
Browse files Browse the repository at this point in the history
  • Loading branch information
RamKrishnan77 committed May 15, 2019
2 parents 1241fee + c0813d2 commit 2e5ecc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Expand Up @@ -20,6 +20,9 @@ import org.apache.spark.sql.Row
import org.apache.spark.sql.test.util.QueryTest
import org.scalatest.BeforeAndAfterAll

import org.apache.carbondata.core.constants.CarbonCommonConstants
import org.apache.carbondata.core.util.CarbonProperties

/**
* test class for describe table .
*/
Expand Down Expand Up @@ -65,10 +68,22 @@ class TestDescribeTable extends QueryTest with BeforeAndAfterAll {
assert(descPar.exists(_.toString().contains("Partition Parameters:")))
}

test(testName = "Compressor Type update from carbon properties") {
sql("drop table if exists b")
sql(sqlText = "create table b(a int,b string) stored by 'carbondata'")
CarbonProperties.getInstance().addProperty(CarbonCommonConstants.COMPRESSOR, "gzip")
val result = sql(sqlText = "desc formatted b").collect()
assert(result.filter(row => row.getString(0).contains("Data File Compressor")).head.getString
(1).equalsIgnoreCase("gzip"))
}

override def afterAll: Unit = {
sql("DROP TABLE Desc1")
sql("DROP TABLE Desc2")
sql("drop table if exists a")
sql("drop table if exists b")
CarbonProperties.getInstance().addProperty(CarbonCommonConstants.COMPRESSOR,
CarbonCommonConstants.DEFAULT_COMPRESSOR)
}

}
Expand Up @@ -113,7 +113,9 @@ private[sql] case class CarbonDescribeFormattedCommand(
CarbonCommonConstants.CARBON_LOAD_MIN_SIZE_INMB_DEFAULT).toFloat), ""),
("Data File Compressor ", tblProps
.getOrElse(CarbonCommonConstants.COMPRESSOR,
CarbonCommonConstants.DEFAULT_COMPRESSOR), ""),
CarbonProperties.getInstance()
.getProperty(CarbonCommonConstants.COMPRESSOR,
CarbonCommonConstants.DEFAULT_COMPRESSOR)), ""),
//////////////////////////////////////////////////////////////////////////////
// Index Information
//////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 2e5ecc7

Please sign in to comment.