Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2195#discussion_r183057775
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateUtil.scala
---
@@ -438,7 +439,17 @@ object PreAggregateUtil {
wrapperTableInfo.getDataMapSchemaList.add(childSchema)
val thriftTable = schemaConverter.fromWrapperToExternalTableInfo(
wrapperTableInfo, dbName, tableName)
- updateSchemaInfo(carbonTable, thriftTable)(sparkSession)
+ try {
+ updateSchemaInfo(carbonTable, thriftTable)(sparkSession)
+ } catch {
+ case ex: Exception =>
+ val dropTableCommand =
CarbonDropDataMapCommand(childSchema.getDataMapName,
+ ifExistsSet = true,
+ Some(TableIdentifier
+ .apply(carbonTable.getTableName,
Some(carbonTable.getDatabaseName))),
+ forceDrop = true)
+ dropTableCommand.processMetadata(sparkSession)
+ }
--- End diff --
need to throw exception from catch block after dropping agg data map
---