VenuReddy2103 commented on a change in pull request #3774:
URL: https://github.com/apache/carbondata/pull/3774#discussion_r437599439



##########
File path: 
integration/spark/src/test/scala/org/apache/carbondata/geo/GeoTest.scala
##########
@@ -82,6 +81,45 @@ class GeoTest extends QueryTest with BeforeAndAfterAll with 
BeforeAndAfterEach {
       case None => assert(false)
     }
   }
+  test("test geo table drop spatial index column") {
+    createTable()
+    loadData()
+    val exception = intercept[MalformedCarbonCommandException](sql(s"alter 
table $table1 drop columns(mygeohash)"))
+    assert(exception.getMessage.contains(
+      s"Columns present in ${CarbonCommonConstants.SPATIAL_INDEX} table 
property cannot be altered."))
+  }
+
+  test("test geo table filter by geo spatial index column") {
+    createTable()
+    loadData()
+    checkAnswer(sql(s"select *from $table1 where mygeohash = '2196036'"),
+      Seq(Row(2196036,1575428400000L,116337069,39951887)))
+  }
+
+  test("test geo table create index on geohandler column") {
+    createTable()
+    loadData()
+    val exception = intercept[MalformedIndexCommandException](sql(
+      s"""
+         | CREATE INDEX bloom_index ON TABLE $table1 (mygeohash)
+         | AS 'bloomfilter'
+         | PROPERTIES('BLOOM_SIZE'='640000', 'BLOOM_FPP'='0.00001')
+      """.stripMargin))
+   assert(exception.getMessage.contains(
+      s"Spatial Index column is not supported, column 'mygeohash' is spatial 
column"))
+  }
+
+  test("test geo table custom properties on geohandler column") {
+    try {
+      createTable(table1,"'COLUMN_META_CACHE' = 'mygeohash',")

Review comment:
       Test framework supports interction of exceptions. Instead of this try 
catch and assert, please use intercept like above testcases.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to