Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2641#discussion_r210781685
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDropDataMapCommand.scala
---
@@ -116,8 +116,12 @@ case class CarbonDropDataMapCommand(
// drop index datamap on the main table
if (mainTable != null &&
DataMapStoreManager.getInstance().getAllDataMap(mainTable).size() > 0) {
- dropDataMapFromSystemFolder(sparkSession)
- return Seq.empty
+ val dmSchemaOp =
DataMapStoreManager.getInstance().getAllDataMap(mainTable).asScala.
+
find(_.getDataMapSchema.getDataMapName.equalsIgnoreCase(dataMapName))
--- End diff --
I think you can use `.exists` instead of `.find` and move this check to
line 118
---