Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2325#discussion_r191037873
--- Diff:
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/datamap/CGDataMapTestCase.scala
---
@@ -420,6 +419,63 @@ class CGDataMapTestCase extends QueryTest with
BeforeAndAfterAll {
sql("select * from normal_test where name='n502670' and
city='c2670'"))
}
+ test("test cg datamap and validate the visible and invisible status of
datamap ") {
+ val tableName = "datamap_test2"
+ val dataMapName1 = "ggdatamap1";
+ sql(s"DROP TABLE IF EXISTS $tableName")
+ sql(
+ s"""
+ | CREATE TABLE $tableName(id INT, name STRING, city STRING, age
INT)
+ | STORED BY 'org.apache.carbondata.format'
+ | TBLPROPERTIES('SORT_COLUMNS'='city,name',
'SORT_SCOPE'='LOCAL_SORT')
+ """.stripMargin)
+ val table =
CarbonMetadata.getInstance().getCarbonTable("default_datamap_test")
+ // register datamap writer
+ sql(
+ s"""
+ | CREATE DATAMAP ggdatamap1 ON TABLE $tableName
+ | USING '${classOf[CGDataMapFactory].getName}'
+ | DMPROPERTIES('index_columns'='name')
+ """.stripMargin)
+ sql(
+ s"""
+ | CREATE DATAMAP ggdatamap2 ON TABLE $tableName
+ | USING '${classOf[CGDataMapFactory].getName}'
+ | DMPROPERTIES('index_columns'='city')
+ """.stripMargin)
+ sql(s"LOAD DATA LOCAL INPATH '$file2' INTO TABLE $tableName
OPTIONS('header'='false')")
+
+ val df1 = sql(s"EXPLAIN EXTENDED SELECT * FROM $tableName WHERE
name='n502670'").collect()
+ assertResult(
--- End diff --
I changed @xuchuanyin
---