You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by xuchuanyin <gi...@git.apache.org> on 2018/07/12 12:24:51 UTC
[GitHub] carbondata pull request #2483: [CARBONDATA-2719][DataMap]Table update/delete...
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
---