Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2483#discussion_r202014417
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonAnalysisRules.scala
---
@@ -55,7 +57,23 @@ case class CarbonIUDAnalysisRule(sparkSession:
SparkSession) extends Rule[Logica
Seq.empty, isDistinct = false), "tupleId")())
val projList =
Seq(UnresolvedAlias(UnresolvedStar(alias.map(Seq(_)))), tupleId)
-
+ val carbonTable =
CarbonEnv.getCarbonTable(table.tableIdentifier)(sparkSession)
+ if (carbonTable != null) {
+ if (CarbonUtil.hasAggregationDataMap(carbonTable)) {
+ throw new UnsupportedOperationException(
+ "Update operation is not supported for tables which have a
pre-aggregate table. " +
+ "Drop pre-aggregate tables to continue.")
+ }
+ if (carbonTable.isChildDataMap) {
+ throw new UnsupportedOperationException(
+ "Update operation is not supported for pre-aggregate table")
+ }
+ val indexSchemas =
DataMapStoreManager.getInstance().getDataMapSchemasOfTable(carbonTable)
+ if (!indexSchemas.isEmpty) {
+ throw new UnsupportedOperationException(
+ "Update operation is not supported for table with datamaps")
--- End diff --
Update operation is not supported for table which has index datamaps
---