Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2512#discussion_r202708129
  
    --- Diff: 
integration/spark2/src/test/scala/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMapSuite.scala
 ---
    @@ -413,6 +414,46 @@ class BloomCoarseGrainDataMapSuite extends QueryTest 
with BeforeAndAfterAll with
         checkQuery("fakeDm", shouldHit = false)
       }
     
    +  test("test create datamaps on different column but hit only one") {
    +    val originDistributedDatamapStatus = 
CarbonProperties.getInstance().getProperty(
    +      CarbonCommonConstants.USE_DISTRIBUTED_DATAMAP,
    +      CarbonCommonConstants.USE_DISTRIBUTED_DATAMAP_DEFAULT
    +    )
    +
    +    CarbonProperties.getInstance()
    +      .addProperty(CarbonCommonConstants.USE_DISTRIBUTED_DATAMAP, "true")
    +    val datamap1 = "datamap1"
    +    val datamap2 = "datamap2"
    +    sql(
    +      s"""
    +         | CREATE TABLE $bloomDMSampleTable(id INT, name STRING, city 
STRING, age INT)
    +         | STORED BY 'carbondata'
    +         |  """.stripMargin)
    +    sql(
    +      s"""
    +         | CREATE DATAMAP $datamap1 ON TABLE $bloomDMSampleTable
    +         | USING 'bloomfilter'
    +         | DMProperties('INDEX_COLUMNS'='name', 'BLOOM_SIZE'='64000', 
'BLOOM_FPP'='0.00001')
    +      """.stripMargin)
    +    sql(
    +      s"""
    +         | CREATE DATAMAP $datamap2 ON TABLE $bloomDMSampleTable
    +         | USING 'bloomfilter'
    +         | DMProperties('INDEX_COLUMNS'='city', 'BLOOM_SIZE'='64000', 
'BLOOM_FPP'='0.00001')
    +      """.stripMargin)
    +
    +    sql(
    +      s"""
    +         | INSERT INTO $bloomDMSampleTable
    +         | 
VALUES(5,'a','beijing',21),(6,'b','shanghai',25),(7,'b','guangzhou',28)
    +      """.stripMargin)
    +    sql(s"SELECT * FROM $bloomDMSampleTable WHERE name='shanghai'").show()
    --- End diff --
    
    use expect to validate the result instead of show


---

Reply via email to