Github user KanakaKumar commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2594#discussion_r207460748
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDataMapRebuildCommand.scala
---
@@ -48,7 +50,17 @@ case class CarbonDataMapRebuildCommand(
)(sparkSession)
}
val provider = DataMapManager.get().getDataMapProvider(table, schema,
sparkSession)
- provider.rebuild()
+ // for non-lazy index datamap, the data of datamap will be generated
immediately after
+ // the datamap is created or the main table is loaded, so there is no
need to
+ // rebuild this datamap.
+ if (!schema.isLazy && provider.isInstanceOf[IndexDataMapProvider]) {
--- End diff --
Right now rebuild call on pre-aggregate DM ithrows
"NoSuchDataMapException". Please handle to give correct message as
pre-aggregate also rebuild is not required.
---