ravipesala commented on a change in pull request #3179: [CARBONDATA-3338]
Support Incremental DataLoad for MV Datamap[with single parent table]
URL: https://github.com/apache/carbondata/pull/3179#discussion_r278904133
##########
File path:
datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVDataMapProvider.scala
##########
@@ -91,22 +108,255 @@ class MVDataMapProvider(
val queryPlan = SparkSQLUtil.execute(
sparkSession.sql(updatedQuery).queryExecution.analyzed,
sparkSession).drop("preAgg")
- val header = logicalPlan.output.map(_.name).mkString(",")
+ var isOverwriteTable = false
+ val isFullRebuild =
+ if (null != dataMapSchema.getProperties.get("full_refresh")) {
+ dataMapSchema.getProperties.get("full_refresh").toBoolean
+ } else {
+ false
+ }
+ if (isFullRebuild) {
+ isOverwriteTable = true
+ }
+ queryPlan.queryExecution.optimizedPlan transformDown {
+ case join@Join(l1, l2, jointype, condition) =>
+ // TODO: Support Incremental loading for multiple tables with join -
CARBONDATA-3340
+ isOverwriteTable = true
+ join
+ }
+ val dataMapTable = CarbonTable
+ .buildFromTablePath(identifier.getTableName,
+ identifier.getDatabaseName,
+ identifier.getTablePath,
+ identifier.getTableId)
+ if (dataMapSchema.isLazy) {
Review comment:
Please take a tablestatus lock on the table ,
1. Check the mapping for which segments needs to be loaded, during the
check you need consider inprogress segments.
2. Create a tablestatus entry to as inprogress along with extra info.
3. If it is lazy and any load in progress just return exception.
4. Pass the segmentid to the load as mergedName .
5. During updating tablestatus again you can get the old inprogress segment
and update it and make entry gain.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services