Github user Indhumathi27 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2180#discussion_r183212178
--- Diff:
integration/spark-common-test/src/test/scala/org/apache/carbondata/datamap/lucene/LuceneFineGrainDataMapSuite.scala
---
@@ -197,13 +197,353 @@ class LuceneFineGrainDataMapSuite extends QueryTest
with BeforeAndAfterAll {
sql("DROP TABLE IF EXISTS datamap_test3")
}
+ test("test lucene fine grain data map for create datamap with Duplicate
Columns") {
+ sql("DROP TABLE IF EXISTS datamap_test_table")
+ sql(
+ """
+ | CREATE TABLE datamap_test_table(id INT, name STRING, city
STRING, age INT)
+ | STORED BY 'carbondata'
+ | TBLPROPERTIES('SORT_COLUMNS'='city,name',
'SORT_SCOPE'='LOCAL_SORT')
+ """.stripMargin)
+ val exception_duplicate_column: Exception =
intercept[MalformedDataMapCommandException] {
+ sql(
+ s"""
+ | CREATE DATAMAP dm ON TABLE datamap_test_table
+ | USING 'lucene'
+ | DMProperties('TEXT_COLUMNS'='name')
+ """.stripMargin)
+ sql(
+ s"""
+ | CREATE DATAMAP dm1 ON TABLE datamap_test_table
+ | USING 'lucene'
+ | DMProperties('TEXT_COLUMNS'='name')
+ """.stripMargin)
+ }
+ assert(exception_duplicate_column.getMessage
+ .contains("Create lucene datamap dm1 failed, datamap already exists
on column(s) name"))
+ sql("drop datamap if exists dm on table datamap_test_table")
+ }
+
+ test("test lucene fine grain data map with wildcard matching ") {
+ sql("DROP TABLE IF EXISTS datamap_test_table")
+ sql(
+ """
+ | CREATE TABLE datamap_test_table(id INT, name STRING, city
STRING, age INT)
+ | STORED BY 'carbondata'
+ | TBLPROPERTIES('SORT_COLUMNS'='city,name',
'SORT_SCOPE'='LOCAL_SORT')
+ """.stripMargin)
+ sql(
+ s"""
+ | CREATE DATAMAP dm ON TABLE datamap_test_table
+ | USING 'lucene'
+ | DMProperties('TEXT_COLUMNS'='Name , cIty')
--- End diff --
okay
---